<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/c++/5/bits/basic_string.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/c++/5/bits</a> - basic_string.h<span style="font-size: 80%;"> (source / <a href="basic_string.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">31</td>
            <td class="headerCovTableEntry">44</td>
            <td class="headerCovTableEntryLo">70.5 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">46</td>
            <td class="headerCovTableEntry">53</td>
            <td class="headerCovTableEntryMed">86.8 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Components for manipulating sequences of characters -*- C++ -*-</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : // Copyright (C) 1997-2015 Free Software Foundation, Inc.
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       6 </span>            : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       7 </span>            : // terms of the GNU General Public License as published by the
<span class="lineNum">       8 </span>            : // Free Software Foundation; either version 3, or (at your option)
<span class="lineNum">       9 </span>            : // any later version.
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      12 </span>            : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      13 </span>            : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      14 </span>            : // GNU General Public License for more details.
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : // Under Section 7 of GPL version 3, you are granted additional
<span class="lineNum">      17 </span>            : // permissions described in the GCC Runtime Library Exception, version
<span class="lineNum">      18 </span>            : // 3.1, as published by the Free Software Foundation.
<span class="lineNum">      19 </span>            : 
<span class="lineNum">      20 </span>            : // You should have received a copy of the GNU General Public License and
<span class="lineNum">      21 </span>            : // a copy of the GCC Runtime Library Exception along with this program;
<span class="lineNum">      22 </span>            : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
<span class="lineNum">      23 </span>            : // &lt;http://www.gnu.org/licenses/&gt;.
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            : /** @file bits/basic_string.h
<span class="lineNum">      26 </span>            :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      27 </span>            :  *  Do not attempt to use it directly. @headername{string}
<span class="lineNum">      28 </span>            :  */
<span class="lineNum">      29 </span>            : 
<span class="lineNum">      30 </span>            : //
<span class="lineNum">      31 </span>            : // ISO C++ 14882: 21 Strings library
<span class="lineNum">      32 </span>            : //
<span class="lineNum">      33 </span>            : 
<span class="lineNum">      34 </span>            : #ifndef _BASIC_STRING_H
<span class="lineNum">      35 </span>            : #define _BASIC_STRING_H 1
<span class="lineNum">      36 </span>            : 
<span class="lineNum">      37 </span>            : #pragma GCC system_header
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span>            : #include &lt;ext/atomicity.h&gt;
<span class="lineNum">      40 </span>            : #include &lt;ext/alloc_traits.h&gt;
<span class="lineNum">      41 </span>            : #include &lt;debug/debug.h&gt;
<span class="lineNum">      42 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">      43 </span>            : #include &lt;initializer_list&gt;
<span class="lineNum">      44 </span>            : #endif
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : namespace std _GLIBCXX_VISIBILITY(default)
<span class="lineNum">      47 </span>            : {
<span class="lineNum">      48 </span>            : _GLIBCXX_BEGIN_NAMESPACE_VERSION
<span class="lineNum">      49 </span>            : 
<span class="lineNum">      50 </span>            : #if _GLIBCXX_USE_CXX11_ABI
<span class="lineNum">      51 </span>            : _GLIBCXX_BEGIN_NAMESPACE_CXX11
<span class="lineNum">      52 </span>            :   /**
<span class="lineNum">      53 </span>            :    *  @class basic_string basic_string.h &lt;string&gt;
<span class="lineNum">      54 </span>            :    *  @brief  Managing sequences of characters and character-like objects.
<span class="lineNum">      55 </span>            :    *
<span class="lineNum">      56 </span>            :    *  @ingroup strings
<span class="lineNum">      57 </span>            :    *  @ingroup sequences
<span class="lineNum">      58 </span>            :    *
<span class="lineNum">      59 </span>            :    *  @tparam _CharT  Type of character
<span class="lineNum">      60 </span>            :    *  @tparam _Traits  Traits for character type, defaults to
<span class="lineNum">      61 </span>            :    *                   char_traits&lt;_CharT&gt;.
<span class="lineNum">      62 </span>            :    *  @tparam _Alloc  Allocator type, defaults to allocator&lt;_CharT&gt;.
<span class="lineNum">      63 </span>            :    *
<span class="lineNum">      64 </span>            :    *  Meets the requirements of a &lt;a href=&quot;tables.html#65&quot;&gt;container&lt;/a&gt;, a
<span class="lineNum">      65 </span>            :    *  &lt;a href=&quot;tables.html#66&quot;&gt;reversible container&lt;/a&gt;, and a
<span class="lineNum">      66 </span>            :    *  &lt;a href=&quot;tables.html#67&quot;&gt;sequence&lt;/a&gt;.  Of the
<span class="lineNum">      67 </span>            :    *  &lt;a href=&quot;tables.html#68&quot;&gt;optional sequence requirements&lt;/a&gt;, only
<span class="lineNum">      68 </span>            :    *  @c push_back, @c at, and @c %array access are supported.
<span class="lineNum">      69 </span>            :    */
<span class="lineNum">      70 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">      71 </span>            :     class basic_string
<span class="lineNum">      72 </span>            :     {
<span class="lineNum">      73 </span>            :       typedef typename __gnu_cxx::__alloc_traits&lt;_Alloc&gt;::template
<span class="lineNum">      74 </span>            :         rebind&lt;_CharT&gt;::other _Char_alloc_type;
<span class="lineNum">      75 </span>            :       typedef __gnu_cxx::__alloc_traits&lt;_Char_alloc_type&gt; _Alloc_traits;
<span class="lineNum">      76 </span>            : 
<span class="lineNum">      77 </span>            :       // Types:
<span class="lineNum">      78 </span>            :     public:
<span class="lineNum">      79 </span>            :       typedef _Traits                                   traits_type;
<span class="lineNum">      80 </span>            :       typedef typename _Traits::char_type               value_type;
<span class="lineNum">      81 </span>            :       typedef _Char_alloc_type                          allocator_type;
<span class="lineNum">      82 </span>            :       typedef typename _Alloc_traits::size_type         size_type;
<span class="lineNum">      83 </span>            :       typedef typename _Alloc_traits::difference_type   difference_type;
<span class="lineNum">      84 </span>            :       typedef typename _Alloc_traits::reference         reference;
<span class="lineNum">      85 </span>            :       typedef typename _Alloc_traits::const_reference   const_reference;
<span class="lineNum">      86 </span>            :       typedef typename _Alloc_traits::pointer           pointer;
<span class="lineNum">      87 </span>            :       typedef typename _Alloc_traits::const_pointer     const_pointer;
<span class="lineNum">      88 </span>            :       typedef __gnu_cxx::__normal_iterator&lt;pointer, basic_string&gt;  iterator;
<span class="lineNum">      89 </span>            :       typedef __gnu_cxx::__normal_iterator&lt;const_pointer, basic_string&gt;
<span class="lineNum">      90 </span>            :                                                         const_iterator;
<span class="lineNum">      91 </span>            :       typedef std::reverse_iterator&lt;const_iterator&gt;       const_reverse_iterator;
<span class="lineNum">      92 </span>            :       typedef std::reverse_iterator&lt;iterator&gt;             reverse_iterator;
<span class="lineNum">      93 </span>            : 
<span class="lineNum">      94 </span>            :       ///  Value returned by various member functions when they fail.
<span class="lineNum">      95 </span>            :       static const size_type    npos = static_cast&lt;size_type&gt;(-1);
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span>            :     private:
<span class="lineNum">      98 </span>            :       // type used for positions in insert, erase etc.
<span class="lineNum">      99 </span>            : #if __cplusplus &lt; 201103L
<span class="lineNum">     100 </span>            :       typedef iterator __const_iterator;
<span class="lineNum">     101 </span>            : #else
<span class="lineNum">     102 </span>            :       typedef const_iterator __const_iterator;
<span class="lineNum">     103 </span>            : #endif
<span class="lineNum">     104 </span>            : 
<span class="lineNum">     105 </span>            :       // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
<span class="lineNum">     106 </span><span class="lineCov">     968489 :       struct _Alloc_hider : allocator_type // TODO check __is_final</span>
<span class="lineNum">     107 </span>            :       {
<span class="lineNum">     108 </span>            :         _Alloc_hider(pointer __dat, const _Alloc&amp; __a = _Alloc())
<span class="lineNum">     109 </span><span class="lineCov">     968180 :         : allocator_type(__a), _M_p(__dat) { }</span>
<span class="lineNum">     110 </span>            : 
<span class="lineNum">     111 </span>            :         pointer _M_p; // The actual data.
<span class="lineNum">     112 </span>            :       };
<span class="lineNum">     113 </span>            : 
<span class="lineNum">     114 </span>            :       _Alloc_hider      _M_dataplus;
<span class="lineNum">     115 </span>            :       size_type         _M_string_length;
<span class="lineNum">     116 </span>            : 
<span class="lineNum">     117 </span>            :       enum { _S_local_capacity = 15 / sizeof(_CharT) };
<span class="lineNum">     118 </span>            : 
<span class="lineNum">     119 </span>            :       union
<span class="lineNum">     120 </span>            :       {
<span class="lineNum">     121 </span>            :         _CharT           _M_local_buf[_S_local_capacity + 1];
<span class="lineNum">     122 </span>            :         size_type        _M_allocated_capacity;
<span class="lineNum">     123 </span>            :       };
<span class="lineNum">     124 </span>            : 
<span class="lineNum">     125 </span>            :       void
<span class="lineNum">     126 </span>            :       _M_data(pointer __p)
<span class="lineNum">     127 </span><span class="lineCov">     862872 :       { _M_dataplus._M_p = __p; }</span>
<span class="lineNum">     128 </span>            : 
<span class="lineNum">     129 </span>            :       void
<span class="lineNum">     130 </span>            :       _M_length(size_type __length)
<span class="lineNum">     131 </span><span class="lineCov">    1806962 :       { _M_string_length = __length; }</span>
<span class="lineNum">     132 </span>            : 
<span class="lineNum">     133 </span>            :       pointer
<span class="lineNum">     134 </span>            :       _M_data() const
<span class="lineNum">     135 </span>            :       { return _M_dataplus._M_p; }
<span class="lineNum">     136 </span>            : 
<span class="lineNum">     137 </span>            :       pointer
<span class="lineNum">     138 </span>            :       _M_local_data()
<span class="lineNum">     139 </span>            :       {
<span class="lineNum">     140 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     141 </span>            :         return std::pointer_traits&lt;pointer&gt;::pointer_to(*_M_local_buf);
<span class="lineNum">     142 </span>            : #else
<span class="lineNum">     143 </span><span class="lineCov">     887865 :         return pointer(_M_local_buf);</span>
<span class="lineNum">     144 </span>            : #endif
<span class="lineNum">     145 </span>            :       }
<span class="lineNum">     146 </span>            : 
<span class="lineNum">     147 </span>            :       const_pointer
<span class="lineNum">     148 </span>            :       _M_local_data() const
<span class="lineNum">     149 </span>            :       {
<span class="lineNum">     150 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     151 </span>            :         return std::pointer_traits&lt;const_pointer&gt;::pointer_to(*_M_local_buf);
<span class="lineNum">     152 </span>            : #else
<span class="lineNum">     153 </span><span class="lineCov">      13052 :         return const_pointer(_M_local_buf);</span>
<span class="lineNum">     154 </span>            : #endif
<span class="lineNum">     155 </span>            :       }
<span class="lineNum">     156 </span>            : 
<span class="lineNum">     157 </span>            :       void
<span class="lineNum">     158 </span>            :       _M_capacity(size_type __capacity)
<span class="lineNum">     159 </span><span class="lineCov">     862872 :       { _M_allocated_capacity = __capacity; }</span>
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            :       void
<span class="lineNum">     162 </span>            :       _M_set_length(size_type __n)
<span class="lineNum">     163 </span>            :       {
<span class="lineNum">     164 </span>            :         _M_length(__n);
<span class="lineNum">     165 </span><span class="lineCov">     955819 :         traits_type::assign(_M_data()[__n], _CharT());</span>
<span class="lineNum">     166 </span>            :       }
<span class="lineNum">     167 </span>            : 
<span class="lineNum">     168 </span>            :       bool
<span class="lineNum">     169 </span>            :       _M_is_local() const
<span class="lineNum">     170 </span>            :       { return _M_data() == _M_local_data(); }
<span class="lineNum">     171 </span>            : 
<span class="lineNum">     172 </span>            :       // Create &amp; Destroy
<span class="lineNum">     173 </span>            :       pointer
<span class="lineNum">     174 </span>            :       _M_create(size_type&amp;, size_type);
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span>            :       void
<span class="lineNum">     177 </span>            :       _M_dispose()
<span class="lineNum">     178 </span>            :       {
<span class="lineNum">     179 </span><span class="lineCov">     968489 :         if (!_M_is_local())</span>
<span class="lineNum">     180 </span>            :           _M_destroy(_M_allocated_capacity);
<span class="lineNum">     181 </span>            :       }
<span class="lineNum">     182 </span>            : 
<span class="lineNum">     183 </span>            :       void
<span class="lineNum">     184 </span>            :       _M_destroy(size_type __size) throw()
<span class="lineNum">     185 </span>            :       { _Alloc_traits::deallocate(_M_get_allocator(), _M_data(), __size + 1); }
<span class="lineNum">     186 </span>            : 
<span class="lineNum">     187 </span>            :       // _M_construct_aux is used to implement the 21.3.1 para 15 which
<span class="lineNum">     188 </span>            :       // requires special behaviour if _InIterator is an integral type
<span class="lineNum">     189 </span>            :       template&lt;typename _InIterator&gt;
<span class="lineNum">     190 </span>            :         void
<span class="lineNum">     191 </span>            :         _M_construct_aux(_InIterator __beg, _InIterator __end,
<span class="lineNum">     192 </span>            :                          std::__false_type)
<span class="lineNum">     193 </span>            :         {
<span class="lineNum">     194 </span>            :           typedef typename iterator_traits&lt;_InIterator&gt;::iterator_category _Tag;
<span class="lineNum">     195 </span><span class="lineCov">     955663 :           _M_construct(__beg, __end, _Tag());</span>
<span class="lineNum">     196 </span>            :         }
<span class="lineNum">     197 </span>            : 
<span class="lineNum">     198 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     199 </span>            :       // 438. Ambiguity in the &quot;do the right thing&quot; clause
<span class="lineNum">     200 </span>            :       template&lt;typename _Integer&gt;
<span class="lineNum">     201 </span>            :         void
<span class="lineNum">     202 </span>            :         _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
<span class="lineNum">     203 </span>            :         { _M_construct_aux_2(static_cast&lt;size_type&gt;(__beg), __end); }
<span class="lineNum">     204 </span>            : 
<span class="lineNum">     205 </span>            :       void
<span class="lineNum">     206 </span>            :       _M_construct_aux_2(size_type __req, _CharT __c)
<span class="lineNum">     207 </span>            :       { _M_construct(__req, __c); }
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span>            :       template&lt;typename _InIterator&gt;
<span class="lineNum">     210 </span>            :         void
<span class="lineNum">     211 </span>            :         _M_construct(_InIterator __beg, _InIterator __end)
<span class="lineNum">     212 </span>            :         {
<span class="lineNum">     213 </span>            :           typedef typename std::__is_integer&lt;_InIterator&gt;::__type _Integral;
<span class="lineNum">     214 </span>            :           _M_construct_aux(__beg, __end, _Integral());
<span class="lineNum">     215 </span>            :         }
<span class="lineNum">     216 </span>            : 
<span class="lineNum">     217 </span>            :       // For Input Iterators, used in istreambuf_iterators, etc.
<span class="lineNum">     218 </span>            :       template&lt;typename _InIterator&gt;
<span class="lineNum">     219 </span>            :         void
<span class="lineNum">     220 </span>            :         _M_construct(_InIterator __beg, _InIterator __end,
<span class="lineNum">     221 </span>            :                      std::input_iterator_tag);
<span class="lineNum">     222 </span>            : 
<span class="lineNum">     223 </span>            :       // For forward_iterators up to random_access_iterators, used for
<span class="lineNum">     224 </span>            :       // string::iterator, _CharT*, etc.
<span class="lineNum">     225 </span>            :       template&lt;typename _FwdIterator&gt;
<span class="lineNum">     226 </span>            :         void
<span class="lineNum">     227 </span>            :         _M_construct(_FwdIterator __beg, _FwdIterator __end,
<span class="lineNum">     228 </span>            :                      std::forward_iterator_tag);
<span class="lineNum">     229 </span>            : 
<span class="lineNum">     230 </span>            :       void
<span class="lineNum">     231 </span>            :       _M_construct(size_type __req, _CharT __c);
<span class="lineNum">     232 </span>            : 
<span class="lineNum">     233 </span>            :       allocator_type&amp;
<span class="lineNum">     234 </span>            :       _M_get_allocator()
<span class="lineNum">     235 </span>            :       { return _M_dataplus; }
<span class="lineNum">     236 </span>            : 
<span class="lineNum">     237 </span>            :       const allocator_type&amp;
<span class="lineNum">     238 </span>            :       _M_get_allocator() const
<span class="lineNum">     239 </span>            :       { return _M_dataplus; }
<span class="lineNum">     240 </span>            : 
<span class="lineNum">     241 </span>            :     private:
<span class="lineNum">     242 </span>            : 
<span class="lineNum">     243 </span>            : #ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST
<span class="lineNum">     244 </span>            :       // The explicit instantiations in misc-inst.cc require this due to
<span class="lineNum">     245 </span>            :       // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64063
<span class="lineNum">     246 </span>            :       template&lt;typename _Tp, bool _Requires =
<span class="lineNum">     247 </span>            :                !__are_same&lt;_Tp, _CharT*&gt;::__value
<span class="lineNum">     248 </span>            :                &amp;&amp; !__are_same&lt;_Tp, const _CharT*&gt;::__value
<span class="lineNum">     249 </span>            :                &amp;&amp; !__are_same&lt;_Tp, iterator&gt;::__value
<span class="lineNum">     250 </span>            :                &amp;&amp; !__are_same&lt;_Tp, const_iterator&gt;::__value&gt;
<span class="lineNum">     251 </span>            :         struct __enable_if_not_native_iterator
<span class="lineNum">     252 </span>            :         { typedef basic_string&amp; __type; };
<span class="lineNum">     253 </span>            :       template&lt;typename _Tp&gt;
<span class="lineNum">     254 </span>            :         struct __enable_if_not_native_iterator&lt;_Tp, false&gt; { };
<span class="lineNum">     255 </span>            : #endif
<span class="lineNum">     256 </span>            : 
<span class="lineNum">     257 </span>            :       size_type
<span class="lineNum">     258 </span>            :       _M_check(size_type __pos, const char* __s) const
<span class="lineNum">     259 </span>            :       {
<span class="lineNum">     260 </span>            :         if (__pos &gt; this-&gt;size())
<span class="lineNum">     261 </span>            :           __throw_out_of_range_fmt(__N(&quot;%s: __pos (which is %zu) &gt; &quot;
<span class="lineNum">     262 </span>            :                                        &quot;this-&gt;size() (which is %zu)&quot;),
<span class="lineNum">     263 </span>            :                                    __s, __pos, this-&gt;size());
<span class="lineNum">     264 </span>            :         return __pos;
<span class="lineNum">     265 </span>            :       }
<span class="lineNum">     266 </span>            : 
<span class="lineNum">     267 </span>            :       void
<span class="lineNum">     268 </span>            :       _M_check_length(size_type __n1, size_type __n2, const char* __s) const
<span class="lineNum">     269 </span>            :       {
<span class="lineNum">     270 </span>            :         if (this-&gt;max_size() - (this-&gt;size() - __n1) &lt; __n2)
<span class="lineNum">     271 </span>            :           __throw_length_error(__N(__s));
<span class="lineNum">     272 </span>            :       }
<span class="lineNum">     273 </span>            : 
<span class="lineNum">     274 </span>            : 
<span class="lineNum">     275 </span>            :       // NB: _M_limit doesn't check for a bad __pos value.
<span class="lineNum">     276 </span>            :       size_type
<span class="lineNum">     277 </span>            :       _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
<span class="lineNum">     278 </span>            :       {
<span class="lineNum">     279 </span>            :         const bool __testoff =  __off &lt; this-&gt;size() - __pos;
<span class="lineNum">     280 </span>            :         return __testoff ? __off : this-&gt;size() - __pos;
<span class="lineNum">     281 </span>            :       }
<span class="lineNum">     282 </span>            : 
<span class="lineNum">     283 </span>            :       // True if _Rep and source do not overlap.
<span class="lineNum">     284 </span>            :       bool
<span class="lineNum">     285 </span>            :       _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
<span class="lineNum">     286 </span>            :       {
<span class="lineNum">     287 </span>            :         return (less&lt;const _CharT*&gt;()(__s, _M_data())
<span class="lineNum">     288 </span>            :                 || less&lt;const _CharT*&gt;()(_M_data() + this-&gt;size(), __s));
<span class="lineNum">     289 </span>            :       }
<span class="lineNum">     290 </span>            : 
<span class="lineNum">     291 </span>            :       // When __n = 1 way faster than the general multichar
<span class="lineNum">     292 </span>            :       // traits_type::copy/move/assign.
<span class="lineNum">     293 </span>            :       static void
<span class="lineNum">     294 </span>            :       _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
<span class="lineNum">     295 </span>            :       {
<span class="lineNum">     296 </span><span class="lineCov">     955819 :         if (__n == 1)</span>
<span class="lineNum">     297 </span>            :           traits_type::assign(*__d, *__s);
<span class="lineNum">     298 </span>            :         else
<span class="lineNum">     299 </span>            :           traits_type::copy(__d, __s, __n);
<span class="lineNum">     300 </span>            :       }
<span class="lineNum">     301 </span>            : 
<span class="lineNum">     302 </span>            :       static void
<span class="lineNum">     303 </span>            :       _S_move(_CharT* __d, const _CharT* __s, size_type __n)
<span class="lineNum">     304 </span>            :       {
<span class="lineNum">     305 </span>            :         if (__n == 1)
<span class="lineNum">     306 </span>            :           traits_type::assign(*__d, *__s);
<span class="lineNum">     307 </span>            :         else
<span class="lineNum">     308 </span>            :           traits_type::move(__d, __s, __n);
<span class="lineNum">     309 </span>            :       }
<span class="lineNum">     310 </span>            : 
<span class="lineNum">     311 </span>            :       static void
<span class="lineNum">     312 </span>            :       _S_assign(_CharT* __d, size_type __n, _CharT __c)
<span class="lineNum">     313 </span>            :       {
<span class="lineNum">     314 </span>            :         if (__n == 1)
<span class="lineNum">     315 </span>            :           traits_type::assign(*__d, __c);
<span class="lineNum">     316 </span>            :         else
<span class="lineNum">     317 </span>            :           traits_type::assign(__d, __n, __c);
<span class="lineNum">     318 </span>            :       }
<span class="lineNum">     319 </span>            : 
<span class="lineNum">     320 </span>            :       // _S_copy_chars is a separate template to permit specialization
<span class="lineNum">     321 </span>            :       // to optimize for the common case of pointers as iterators.
<span class="lineNum">     322 </span>            :       template&lt;class _Iterator&gt;
<span class="lineNum">     323 </span>            :         static void
<span class="lineNum">     324 </span>            :         _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
<span class="lineNum">     325 </span>            :         {
<span class="lineNum">     326 </span>            :           for (; __k1 != __k2; ++__k1, ++__p)
<span class="lineNum">     327 </span>            :             traits_type::assign(*__p, *__k1); // These types are off.
<span class="lineNum">     328 </span>            :         }
<span class="lineNum">     329 </span>            : 
<span class="lineNum">     330 </span>            :       static void
<span class="lineNum">     331 </span>            :       _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
<span class="lineNum">     332 </span>            :       { _S_copy_chars(__p, __k1.base(), __k2.base()); }
<span class="lineNum">     333 </span>            : 
<span class="lineNum">     334 </span>            :       static void
<span class="lineNum">     335 </span>            :       _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
<span class="lineNum">     336 </span>            :       _GLIBCXX_NOEXCEPT
<span class="lineNum">     337 </span>            :       { _S_copy_chars(__p, __k1.base(), __k2.base()); }
<span class="lineNum">     338 </span>            : 
<span class="lineNum">     339 </span>            :       static void
<span class="lineNum">     340 </span>            :       _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
<span class="lineNum">     341 </span>            :       { _S_copy(__p, __k1, __k2 - __k1); }
<span class="lineNum">     342 </span>            : 
<span class="lineNum">     343 </span>            :       static void
<span class="lineNum">     344 </span>            :       _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
<span class="lineNum">     345 </span>            :       _GLIBCXX_NOEXCEPT
<span class="lineNum">     346 </span>            :       { _S_copy(__p, __k1, __k2 - __k1); }
<span class="lineNum">     347 </span>            : 
<span class="lineNum">     348 </span>            :       static int
<span class="lineNum">     349 </span>            :       _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
<span class="lineNum">     350 </span>            :       {
<span class="lineNum">     351 </span>            :         const difference_type __d = difference_type(__n1 - __n2);
<span class="lineNum">     352 </span>            : 
<span class="lineNum">     353 </span>            :         if (__d &gt; __gnu_cxx::__numeric_traits&lt;int&gt;::__max)
<span class="lineNum">     354 </span>            :           return __gnu_cxx::__numeric_traits&lt;int&gt;::__max;
<span class="lineNum">     355 </span>            :         else if (__d &lt; __gnu_cxx::__numeric_traits&lt;int&gt;::__min)
<span class="lineNum">     356 </span>            :           return __gnu_cxx::__numeric_traits&lt;int&gt;::__min;
<span class="lineNum">     357 </span>            :         else
<span class="lineNum">     358 </span>            :           return int(__d);
<span class="lineNum">     359 </span>            :       }
<span class="lineNum">     360 </span>            : 
<span class="lineNum">     361 </span>            :       void
<span class="lineNum">     362 </span>            :       _M_assign(const basic_string&amp; __rcs);
<span class="lineNum">     363 </span>            : 
<span class="lineNum">     364 </span>            :       void
<span class="lineNum">     365 </span>            :       _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
<span class="lineNum">     366 </span>            :                 size_type __len2);
<span class="lineNum">     367 </span>            : 
<span class="lineNum">     368 </span>            :       void
<span class="lineNum">     369 </span>            :       _M_erase(size_type __pos, size_type __n);
<span class="lineNum">     370 </span>            : 
<span class="lineNum">     371 </span>            :     public:
<span class="lineNum">     372 </span>            :       // Construct/copy/destroy:
<span class="lineNum">     373 </span>            :       // NB: We overload ctors in some cases instead of using default
<span class="lineNum">     374 </span>            :       // arguments, per 17.4.4.4 para. 2 item 2.
<span class="lineNum">     375 </span>            : 
<span class="lineNum">     376 </span>            :       /**
<span class="lineNum">     377 </span>            :        *  @brief  Default constructor creates an empty string.
<span class="lineNum">     378 </span>            :        */
<span class="lineNum">     379 </span>            :       basic_string()
<span class="lineNum">     380 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     381 </span>            :       noexcept(is_nothrow_default_constructible&lt;_Alloc&gt;::value)
<span class="lineNum">     382 </span>            : #endif
<span class="lineNum">     383 </span>            :       : _M_dataplus(_M_local_data())
<span class="lineNum">     384 </span>            :       { _M_set_length(0); }
<span class="lineNum">     385 </span>            : 
<span class="lineNum">     386 </span>            :       /**
<span class="lineNum">     387 </span>            :        *  @brief  Construct an empty string using allocator @a a.
<span class="lineNum">     388 </span>            :        */
<span class="lineNum">     389 </span>            :       explicit
<span class="lineNum">     390 </span>            :       basic_string(const _Alloc&amp; __a)
<span class="lineNum">     391 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     392 </span>            :       { _M_set_length(0); }
<span class="lineNum">     393 </span>            : 
<span class="lineNum">     394 </span>            :       /**
<span class="lineNum">     395 </span>            :        *  @brief  Construct string with copy of value of @a __str.
<span class="lineNum">     396 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     397 </span>            :        */
<span class="lineNum">     398 </span>            :       basic_string(const basic_string&amp; __str)
<span class="lineNum">     399 </span>            :       : _M_dataplus(_M_local_data(), __str._M_get_allocator()) // TODO A traits
<span class="lineNum">     400 </span><span class="lineCov">      80715 :       { _M_construct(__str._M_data(), __str._M_data() + __str.length()); }</span>
<span class="lineNum">     401 </span>            : 
<span class="lineNum">     402 </span>            :       /**
<span class="lineNum">     403 </span>            :        *  @brief  Construct string as copy of a substring.
<span class="lineNum">     404 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     405 </span>            :        *  @param  __pos  Index of first character to copy from.
<span class="lineNum">     406 </span>            :        *  @param  __n  Number of characters to copy (default remainder).
<span class="lineNum">     407 </span>            :        */
<span class="lineNum">     408 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     409 </span>            :       // 2402. [this constructor] shouldn't use Allocator()
<span class="lineNum">     410 </span>            :       basic_string(const basic_string&amp; __str, size_type __pos,
<span class="lineNum">     411 </span>            :                    size_type __n = npos)
<span class="lineNum">     412 </span>            :       : _M_dataplus(_M_local_data())
<span class="lineNum">     413 </span>            :       {
<span class="lineNum">     414 </span>            :         const _CharT* __start = __str._M_data()
<span class="lineNum">     415 </span>            :           + __str._M_check(__pos, &quot;basic_string::basic_string&quot;);
<span class="lineNum">     416 </span>            :         _M_construct(__start, __start + __str._M_limit(__pos, __n));
<span class="lineNum">     417 </span>            :       }
<span class="lineNum">     418 </span>            : 
<span class="lineNum">     419 </span>            :       /**
<span class="lineNum">     420 </span>            :        *  @brief  Construct string as copy of a substring.
<span class="lineNum">     421 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     422 </span>            :        *  @param  __pos  Index of first character to copy from.
<span class="lineNum">     423 </span>            :        *  @param  __n  Number of characters to copy (default remainder).
<span class="lineNum">     424 </span>            :        *  @param  __a  Allocator to use.
<span class="lineNum">     425 </span>            :        */
<span class="lineNum">     426 </span>            :       basic_string(const basic_string&amp; __str, size_type __pos,
<span class="lineNum">     427 </span>            :                    size_type __n, const _Alloc&amp; __a)
<span class="lineNum">     428 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     429 </span>            :       {
<span class="lineNum">     430 </span>            :         const _CharT* __start
<span class="lineNum">     431 </span>            :           = __str._M_data() + __str._M_check(__pos, &quot;string::string&quot;);
<span class="lineNum">     432 </span>            :         _M_construct(__start, __start + __str._M_limit(__pos, __n));
<span class="lineNum">     433 </span>            :       }
<span class="lineNum">     434 </span>            : 
<span class="lineNum">     435 </span>            :       /**
<span class="lineNum">     436 </span>            :        *  @brief  Construct string initialized by a character %array.
<span class="lineNum">     437 </span>            :        *  @param  __s  Source character %array.
<span class="lineNum">     438 </span>            :        *  @param  __n  Number of characters to copy.
<span class="lineNum">     439 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">     440 </span>            :        *
<span class="lineNum">     441 </span>            :        *  NB: @a __s must have at least @a __n characters, &amp;apos;\\0&amp;apos;
<span class="lineNum">     442 </span>            :        *  has no special meaning.
<span class="lineNum">     443 </span>            :        */
<span class="lineNum">     444 </span>            :       basic_string(const _CharT* __s, size_type __n,
<span class="lineNum">     445 </span>            :                    const _Alloc&amp; __a = _Alloc())
<span class="lineNum">     446 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     447 </span><span class="lineCov">     850558 :       { _M_construct(__s, __s + __n); }</span>
<span class="lineNum">     448 </span>            : 
<span class="lineNum">     449 </span>            :       /**
<span class="lineNum">     450 </span>            :        *  @brief  Construct string as copy of a C string.
<span class="lineNum">     451 </span>            :        *  @param  __s  Source C string.
<a name="452"><span class="lineNum">     452 </span>            :        *  @param  __a  Allocator to use (default is default allocator).</a>
<span class="lineNum">     453 </span>            :        */
<span class="lineNum">     454 </span><span class="lineCov">      24365 :       basic_string(const _CharT* __s, const _Alloc&amp; __a = _Alloc())</span>
<span class="lineNum">     455 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     456 </span><span class="lineCov">      73095 :       { _M_construct(__s, __s ? __s + traits_type::length(__s) : __s+npos); }</span>
<span class="lineNum">     457 </span>            : 
<span class="lineNum">     458 </span>            :       /**
<span class="lineNum">     459 </span>            :        *  @brief  Construct string as multiple characters.
<span class="lineNum">     460 </span>            :        *  @param  __n  Number of characters.
<span class="lineNum">     461 </span>            :        *  @param  __c  Character to use.
<span class="lineNum">     462 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">     463 </span>            :        */
<span class="lineNum">     464 </span>            :       basic_string(size_type __n, _CharT __c, const _Alloc&amp; __a = _Alloc())
<span class="lineNum">     465 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     466 </span><span class="lineNoCov">          0 :       { _M_construct(__n, __c); }</span>
<span class="lineNum">     467 </span>            : 
<span class="lineNum">     468 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     469 </span>            :       /**
<span class="lineNum">     470 </span>            :        *  @brief  Move construct string.
<span class="lineNum">     471 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     472 </span>            :        *
<span class="lineNum">     473 </span>            :        *  The newly-created string contains the exact contents of @a __str.
<span class="lineNum">     474 </span>            :        *  @a __str is a valid, but unspecified string.
<span class="lineNum">     475 </span>            :        **/
<span class="lineNum">     476 </span>            :       basic_string(basic_string&amp;&amp; __str) noexcept
<span class="lineNum">     477 </span>            :       : _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator()))
<span class="lineNum">     478 </span>            :       {
<span class="lineNum">     479 </span>            :         if (__str._M_is_local())
<span class="lineNum">     480 </span>            :           {
<span class="lineNum">     481 </span>            :             traits_type::copy(_M_local_buf, __str._M_local_buf,
<span class="lineNum">     482 </span>            :                               _S_local_capacity + 1);
<span class="lineNum">     483 </span>            :           }
<span class="lineNum">     484 </span>            :         else
<span class="lineNum">     485 </span>            :           {
<span class="lineNum">     486 </span>            :             _M_data(__str._M_data());
<span class="lineNum">     487 </span>            :             _M_capacity(__str._M_allocated_capacity);
<span class="lineNum">     488 </span>            :           }
<span class="lineNum">     489 </span>            : 
<span class="lineNum">     490 </span>            :         // Must use _M_length() here not _M_set_length() because
<span class="lineNum">     491 </span>            :         // basic_stringbuf relies on writing into unallocated capacity so
<span class="lineNum">     492 </span>            :         // we mess up the contents if we put a '\0' in the string.
<span class="lineNum">     493 </span>            :         _M_length(__str.length());
<span class="lineNum">     494 </span>            :         __str._M_data(__str._M_local_data());
<span class="lineNum">     495 </span>            :         __str._M_set_length(0);
<span class="lineNum">     496 </span>            :       }
<span class="lineNum">     497 </span>            : 
<span class="lineNum">     498 </span>            :       /**
<span class="lineNum">     499 </span>            :        *  @brief  Construct string from an initializer %list.
<span class="lineNum">     500 </span>            :        *  @param  __l  std::initializer_list of characters.
<span class="lineNum">     501 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">     502 </span>            :        */
<span class="lineNum">     503 </span>            :       basic_string(initializer_list&lt;_CharT&gt; __l, const _Alloc&amp; __a = _Alloc())
<span class="lineNum">     504 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     505 </span>            :       { _M_construct(__l.begin(), __l.end()); }
<span class="lineNum">     506 </span>            : 
<span class="lineNum">     507 </span>            :       basic_string(const basic_string&amp; __str, const _Alloc&amp; __a)
<span class="lineNum">     508 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     509 </span>            :       { _M_construct(__str.begin(), __str.end()); }
<span class="lineNum">     510 </span>            : 
<span class="lineNum">     511 </span>            :       basic_string(basic_string&amp;&amp; __str, const _Alloc&amp; __a)
<span class="lineNum">     512 </span>            :       : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     513 </span>            :       {
<span class="lineNum">     514 </span>            :         if (__str.get_allocator() == __a)
<span class="lineNum">     515 </span>            :           *this = std::move(__str);
<span class="lineNum">     516 </span>            :         else
<span class="lineNum">     517 </span>            :           _M_construct(__str.begin(), __str.end());
<span class="lineNum">     518 </span>            :       }
<span class="lineNum">     519 </span>            : 
<span class="lineNum">     520 </span>            : #endif // C++11
<span class="lineNum">     521 </span>            : 
<span class="lineNum">     522 </span>            :       /**
<span class="lineNum">     523 </span>            :        *  @brief  Construct string as copy of a range.
<span class="lineNum">     524 </span>            :        *  @param  __beg  Start of range.
<span class="lineNum">     525 </span>            :        *  @param  __end  End of range.
<span class="lineNum">     526 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">     527 </span>            :        */
<span class="lineNum">     528 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     529 </span>            :       template&lt;typename _InputIterator,
<span class="lineNum">     530 </span>            :                typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;
<span class="lineNum">     531 </span>            : #else
<span class="lineNum">     532 </span>            :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     533 </span>            : #endif
<span class="lineNum">     534 </span>            :         basic_string(_InputIterator __beg, _InputIterator __end,
<span class="lineNum">     535 </span>            :                      const _Alloc&amp; __a = _Alloc())
<span class="lineNum">     536 </span>            :         : _M_dataplus(_M_local_data(), __a)
<span class="lineNum">     537 </span>            :         { _M_construct(__beg, __end); }
<span class="lineNum">     538 </span>            : 
<span class="lineNum">     539 </span>            :       /**
<span class="lineNum">     540 </span>            :        *  @brief  Destroy the string instance.
<span class="lineNum">     541 </span>            :        */
<span class="lineNum">     542 </span>            :       ~basic_string()
<span class="lineNum">     543 </span><span class="lineCov">     968489 :       { _M_dispose(); }</span>
<span class="lineNum">     544 </span>            : 
<span class="lineNum">     545 </span>            :       /**
<span class="lineNum">     546 </span>            :        *  @brief  Assign the value of @a str to this string.
<span class="lineNum">     547 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     548 </span>            :        */
<span class="lineNum">     549 </span>            :       basic_string&amp;
<span class="lineNum">     550 </span>            :       operator=(const basic_string&amp; __str)
<span class="lineNum">     551 </span>            :       { return this-&gt;assign(__str); }
<span class="lineNum">     552 </span>            : 
<span class="lineNum">     553 </span>            :       /**
<span class="lineNum">     554 </span>            :        *  @brief  Copy contents of @a s into this string.
<span class="lineNum">     555 </span>            :        *  @param  __s  Source null-terminated string.
<span class="lineNum">     556 </span>            :        */
<span class="lineNum">     557 </span>            :       basic_string&amp;
<span class="lineNum">     558 </span>            :       operator=(const _CharT* __s)
<span class="lineNum">     559 </span><span class="lineNoCov">          0 :       { return this-&gt;assign(__s); }</span>
<span class="lineNum">     560 </span>            : 
<span class="lineNum">     561 </span>            :       /**
<span class="lineNum">     562 </span>            :        *  @brief  Set value to string of length 1.
<span class="lineNum">     563 </span>            :        *  @param  __c  Source character.
<span class="lineNum">     564 </span>            :        *
<span class="lineNum">     565 </span>            :        *  Assigning to a character makes this string length 1 and
<span class="lineNum">     566 </span>            :        *  (*this)[0] == @a c.
<span class="lineNum">     567 </span>            :        */
<span class="lineNum">     568 </span>            :       basic_string&amp;
<span class="lineNum">     569 </span>            :       operator=(_CharT __c)
<span class="lineNum">     570 </span>            :       {
<span class="lineNum">     571 </span>            :         this-&gt;assign(1, __c);
<span class="lineNum">     572 </span>            :         return *this;
<span class="lineNum">     573 </span>            :       }
<span class="lineNum">     574 </span>            : 
<span class="lineNum">     575 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     576 </span>            :       /**
<span class="lineNum">     577 </span>            :        *  @brief  Move assign the value of @a str to this string.
<span class="lineNum">     578 </span>            :        *  @param  __str  Source string.
<span class="lineNum">     579 </span>            :        *
<span class="lineNum">     580 </span>            :        *  The contents of @a str are moved into this string (without copying).
<span class="lineNum">     581 </span>            :        *  @a str is a valid, but unspecified string.
<span class="lineNum">     582 </span>            :        **/
<span class="lineNum">     583 </span>            :       // PR 58265, this should be noexcept.
<span class="lineNum">     584 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     585 </span>            :       // 2063. Contradictory requirements for string move assignment
<span class="lineNum">     586 </span>            :       basic_string&amp;
<span class="lineNum">     587 </span>            :       operator=(basic_string&amp;&amp; __str)
<span class="lineNum">     588 </span>            :       {
<span class="lineNum">     589 </span>            :         this-&gt;swap(__str);
<span class="lineNum">     590 </span>            :         return *this;
<span class="lineNum">     591 </span>            :       }
<span class="lineNum">     592 </span>            : 
<span class="lineNum">     593 </span>            :       /**
<span class="lineNum">     594 </span>            :        *  @brief  Set value to string constructed from initializer %list.
<span class="lineNum">     595 </span>            :        *  @param  __l  std::initializer_list.
<span class="lineNum">     596 </span>            :        */
<span class="lineNum">     597 </span>            :       basic_string&amp;
<span class="lineNum">     598 </span>            :       operator=(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">     599 </span>            :       {
<span class="lineNum">     600 </span>            :         this-&gt;assign(__l.begin(), __l.size());
<span class="lineNum">     601 </span>            :         return *this;
<span class="lineNum">     602 </span>            :       }
<span class="lineNum">     603 </span>            : #endif // C++11
<span class="lineNum">     604 </span>            : 
<span class="lineNum">     605 </span>            :       // Iterators:
<span class="lineNum">     606 </span>            :       /**
<span class="lineNum">     607 </span>            :        *  Returns a read/write iterator that points to the first character in
<span class="lineNum">     608 </span>            :        *  the %string.
<span class="lineNum">     609 </span>            :        */
<span class="lineNum">     610 </span>            :       iterator
<span class="lineNum">     611 </span>            :       begin() _GLIBCXX_NOEXCEPT
<span class="lineNum">     612 </span>            :       { return iterator(_M_data()); }
<span class="lineNum">     613 </span>            : 
<span class="lineNum">     614 </span>            :       /**
<span class="lineNum">     615 </span>            :        *  Returns a read-only (constant) iterator that points to the first
<span class="lineNum">     616 </span>            :        *  character in the %string.
<span class="lineNum">     617 </span>            :        */
<span class="lineNum">     618 </span>            :       const_iterator
<span class="lineNum">     619 </span>            :       begin() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     620 </span>            :       { return const_iterator(_M_data()); }
<span class="lineNum">     621 </span>            : 
<span class="lineNum">     622 </span>            :       /**
<span class="lineNum">     623 </span>            :        *  Returns a read/write iterator that points one past the last
<span class="lineNum">     624 </span>            :        *  character in the %string.
<span class="lineNum">     625 </span>            :        */
<span class="lineNum">     626 </span>            :       iterator
<span class="lineNum">     627 </span>            :       end() _GLIBCXX_NOEXCEPT
<span class="lineNum">     628 </span><span class="lineCov">          1 :       { return iterator(_M_data() + this-&gt;size()); }</span>
<span class="lineNum">     629 </span>            : 
<span class="lineNum">     630 </span>            :       /**
<span class="lineNum">     631 </span>            :        *  Returns a read-only (constant) iterator that points one past the
<span class="lineNum">     632 </span>            :        *  last character in the %string.
<span class="lineNum">     633 </span>            :        */
<span class="lineNum">     634 </span>            :       const_iterator
<span class="lineNum">     635 </span>            :       end() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     636 </span><span class="lineNoCov">          0 :       { return const_iterator(_M_data() + this-&gt;size()); }</span>
<span class="lineNum">     637 </span>            : 
<span class="lineNum">     638 </span>            :       /**
<span class="lineNum">     639 </span>            :        *  Returns a read/write reverse iterator that points to the last
<span class="lineNum">     640 </span>            :        *  character in the %string.  Iteration is done in reverse element
<span class="lineNum">     641 </span>            :        *  order.
<span class="lineNum">     642 </span>            :        */
<span class="lineNum">     643 </span>            :       reverse_iterator
<span class="lineNum">     644 </span>            :       rbegin() _GLIBCXX_NOEXCEPT
<span class="lineNum">     645 </span>            :       { return reverse_iterator(this-&gt;end()); }
<span class="lineNum">     646 </span>            : 
<span class="lineNum">     647 </span>            :       /**
<span class="lineNum">     648 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     649 </span>            :        *  to the last character in the %string.  Iteration is done in
<span class="lineNum">     650 </span>            :        *  reverse element order.
<span class="lineNum">     651 </span>            :        */
<span class="lineNum">     652 </span>            :       const_reverse_iterator
<span class="lineNum">     653 </span>            :       rbegin() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     654 </span>            :       { return const_reverse_iterator(this-&gt;end()); }
<span class="lineNum">     655 </span>            : 
<span class="lineNum">     656 </span>            :       /**
<span class="lineNum">     657 </span>            :        *  Returns a read/write reverse iterator that points to one before the
<span class="lineNum">     658 </span>            :        *  first character in the %string.  Iteration is done in reverse
<span class="lineNum">     659 </span>            :        *  element order.
<span class="lineNum">     660 </span>            :        */
<span class="lineNum">     661 </span>            :       reverse_iterator
<span class="lineNum">     662 </span>            :       rend() _GLIBCXX_NOEXCEPT
<span class="lineNum">     663 </span>            :       { return reverse_iterator(this-&gt;begin()); }
<span class="lineNum">     664 </span>            : 
<span class="lineNum">     665 </span>            :       /**
<span class="lineNum">     666 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     667 </span>            :        *  to one before the first character in the %string.  Iteration
<span class="lineNum">     668 </span>            :        *  is done in reverse element order.
<span class="lineNum">     669 </span>            :        */
<span class="lineNum">     670 </span>            :       const_reverse_iterator
<span class="lineNum">     671 </span>            :       rend() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     672 </span>            :       { return const_reverse_iterator(this-&gt;begin()); }
<span class="lineNum">     673 </span>            : 
<span class="lineNum">     674 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     675 </span>            :       /**
<span class="lineNum">     676 </span>            :        *  Returns a read-only (constant) iterator that points to the first
<span class="lineNum">     677 </span>            :        *  character in the %string.
<span class="lineNum">     678 </span>            :        */
<span class="lineNum">     679 </span>            :       const_iterator
<span class="lineNum">     680 </span>            :       cbegin() const noexcept
<span class="lineNum">     681 </span>            :       { return const_iterator(this-&gt;_M_data()); }
<span class="lineNum">     682 </span>            : 
<span class="lineNum">     683 </span>            :       /**
<span class="lineNum">     684 </span>            :        *  Returns a read-only (constant) iterator that points one past the
<span class="lineNum">     685 </span>            :        *  last character in the %string.
<span class="lineNum">     686 </span>            :        */
<span class="lineNum">     687 </span>            :       const_iterator
<span class="lineNum">     688 </span>            :       cend() const noexcept
<span class="lineNum">     689 </span>            :       { return const_iterator(this-&gt;_M_data() + this-&gt;size()); }
<span class="lineNum">     690 </span>            : 
<span class="lineNum">     691 </span>            :       /**
<span class="lineNum">     692 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     693 </span>            :        *  to the last character in the %string.  Iteration is done in
<span class="lineNum">     694 </span>            :        *  reverse element order.
<span class="lineNum">     695 </span>            :        */
<span class="lineNum">     696 </span>            :       const_reverse_iterator
<span class="lineNum">     697 </span>            :       crbegin() const noexcept
<span class="lineNum">     698 </span>            :       { return const_reverse_iterator(this-&gt;end()); }
<span class="lineNum">     699 </span>            : 
<span class="lineNum">     700 </span>            :       /**
<span class="lineNum">     701 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     702 </span>            :        *  to one before the first character in the %string.  Iteration
<span class="lineNum">     703 </span>            :        *  is done in reverse element order.
<span class="lineNum">     704 </span>            :        */
<span class="lineNum">     705 </span>            :       const_reverse_iterator
<span class="lineNum">     706 </span>            :       crend() const noexcept
<span class="lineNum">     707 </span>            :       { return const_reverse_iterator(this-&gt;begin()); }
<span class="lineNum">     708 </span>            : #endif
<span class="lineNum">     709 </span>            : 
<span class="lineNum">     710 </span>            :     public:
<span class="lineNum">     711 </span>            :       // Capacity:
<span class="lineNum">     712 </span>            :       ///  Returns the number of characters in the string, not including any
<span class="lineNum">     713 </span>            :       ///  null-termination.
<span class="lineNum">     714 </span>            :       size_type
<span class="lineNum">     715 </span>            :       size() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     716 </span>            :       { return _M_string_length; }
<span class="lineNum">     717 </span>            : 
<span class="lineNum">     718 </span>            :       ///  Returns the number of characters in the string, not including any
<span class="lineNum">     719 </span>            :       ///  null-termination.
<span class="lineNum">     720 </span>            :       size_type
<span class="lineNum">     721 </span>            :       length() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     722 </span>            :       { return _M_string_length; }
<span class="lineNum">     723 </span>            : 
<span class="lineNum">     724 </span>            :       ///  Returns the size() of the largest possible %string.
<span class="lineNum">     725 </span>            :       size_type
<span class="lineNum">     726 </span>            :       max_size() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     727 </span>            :       { return (_Alloc_traits::max_size(_M_get_allocator()) - 1) / 2; }
<span class="lineNum">     728 </span>            : 
<span class="lineNum">     729 </span>            :       /**
<span class="lineNum">     730 </span>            :        *  @brief  Resizes the %string to the specified number of characters.
<span class="lineNum">     731 </span>            :        *  @param  __n  Number of characters the %string should contain.
<span class="lineNum">     732 </span>            :        *  @param  __c  Character to fill any new elements.
<span class="lineNum">     733 </span>            :        *
<span class="lineNum">     734 </span>            :        *  This function will %resize the %string to the specified
<span class="lineNum">     735 </span>            :        *  number of characters.  If the number is smaller than the
<span class="lineNum">     736 </span>            :        *  %string's current size the %string is truncated, otherwise
<span class="lineNum">     737 </span>            :        *  the %string is extended and new elements are %set to @a __c.
<span class="lineNum">     738 </span>            :        */
<span class="lineNum">     739 </span>            :       void
<span class="lineNum">     740 </span>            :       resize(size_type __n, _CharT __c);
<span class="lineNum">     741 </span>            : 
<span class="lineNum">     742 </span>            :       /**
<span class="lineNum">     743 </span>            :        *  @brief  Resizes the %string to the specified number of characters.
<span class="lineNum">     744 </span>            :        *  @param  __n  Number of characters the %string should contain.
<span class="lineNum">     745 </span>            :        *
<span class="lineNum">     746 </span>            :        *  This function will resize the %string to the specified length.  If
<span class="lineNum">     747 </span>            :        *  the new size is smaller than the %string's current size the %string
<span class="lineNum">     748 </span>            :        *  is truncated, otherwise the %string is extended and new characters
<span class="lineNum">     749 </span>            :        *  are default-constructed.  For basic types such as char, this means
<span class="lineNum">     750 </span>            :        *  setting them to 0.
<span class="lineNum">     751 </span>            :        */
<span class="lineNum">     752 </span>            :       void
<span class="lineNum">     753 </span>            :       resize(size_type __n)
<span class="lineNum">     754 </span><span class="lineNoCov">          0 :       { this-&gt;resize(__n, _CharT()); }</span>
<span class="lineNum">     755 </span>            : 
<span class="lineNum">     756 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     757 </span>            :       ///  A non-binding request to reduce capacity() to size().
<span class="lineNum">     758 </span>            :       void
<span class="lineNum">     759 </span>            :       shrink_to_fit() noexcept
<span class="lineNum">     760 </span>            :       {
<span class="lineNum">     761 </span>            : #if __cpp_exceptions
<span class="lineNum">     762 </span>            :         if (capacity() &gt; size())
<span class="lineNum">     763 </span>            :           {
<span class="lineNum">     764 </span>            :             try
<span class="lineNum">     765 </span>            :               { reserve(0); }
<span class="lineNum">     766 </span>            :             catch(...)
<span class="lineNum">     767 </span>            :               { }
<span class="lineNum">     768 </span>            :           }
<span class="lineNum">     769 </span>            : #endif
<span class="lineNum">     770 </span>            :       }
<span class="lineNum">     771 </span>            : #endif
<span class="lineNum">     772 </span>            : 
<span class="lineNum">     773 </span>            :       /**
<span class="lineNum">     774 </span>            :        *  Returns the total number of characters that the %string can hold
<span class="lineNum">     775 </span>            :        *  before needing to allocate more memory.
<span class="lineNum">     776 </span>            :        */
<span class="lineNum">     777 </span>            :       size_type
<span class="lineNum">     778 </span>            :       capacity() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     779 </span>            :       {
<span class="lineNum">     780 </span>            :         return _M_is_local() ? size_type(_S_local_capacity)
<span class="lineNum">     781 </span>            :                              : _M_allocated_capacity;
<span class="lineNum">     782 </span>            :       }
<span class="lineNum">     783 </span>            : 
<span class="lineNum">     784 </span>            :       /**
<span class="lineNum">     785 </span>            :        *  @brief  Attempt to preallocate enough memory for specified number of
<span class="lineNum">     786 </span>            :        *          characters.
<span class="lineNum">     787 </span>            :        *  @param  __res_arg  Number of characters required.
<span class="lineNum">     788 </span>            :        *  @throw  std::length_error  If @a __res_arg exceeds @c max_size().
<span class="lineNum">     789 </span>            :        *
<span class="lineNum">     790 </span>            :        *  This function attempts to reserve enough memory for the
<span class="lineNum">     791 </span>            :        *  %string to hold the specified number of characters.  If the
<span class="lineNum">     792 </span>            :        *  number requested is more than max_size(), length_error is
<span class="lineNum">     793 </span>            :        *  thrown.
<span class="lineNum">     794 </span>            :        *
<span class="lineNum">     795 </span>            :        *  The advantage of this function is that if optimal code is a
<span class="lineNum">     796 </span>            :        *  necessity and the user can determine the string length that will be
<span class="lineNum">     797 </span>            :        *  required, the user can reserve the memory in %advance, and thus
<span class="lineNum">     798 </span>            :        *  prevent a possible reallocation of memory and copying of %string
<span class="lineNum">     799 </span>            :        *  data.
<span class="lineNum">     800 </span>            :        */
<span class="lineNum">     801 </span>            :       void
<span class="lineNum">     802 </span>            :       reserve(size_type __res_arg = 0);
<span class="lineNum">     803 </span>            : 
<span class="lineNum">     804 </span>            :       /**
<span class="lineNum">     805 </span>            :        *  Erases the string, making it empty.
<span class="lineNum">     806 </span>            :        */
<span class="lineNum">     807 </span>            :       void
<span class="lineNum">     808 </span>            :       clear() _GLIBCXX_NOEXCEPT
<span class="lineNum">     809 </span>            :       { _M_set_length(0); }
<span class="lineNum">     810 </span>            : 
<span class="lineNum">     811 </span>            :       /**
<span class="lineNum">     812 </span>            :        *  Returns true if the %string is empty.  Equivalent to 
<span class="lineNum">     813 </span>            :        *  &lt;code&gt;*this == &quot;&quot;&lt;/code&gt;.
<span class="lineNum">     814 </span>            :        */
<span class="lineNum">     815 </span>            :       bool
<span class="lineNum">     816 </span>            :       empty() const _GLIBCXX_NOEXCEPT
<span class="lineNum">     817 </span>            :       { return this-&gt;size() == 0; }
<span class="lineNum">     818 </span>            : 
<span class="lineNum">     819 </span>            :       // Element access:
<span class="lineNum">     820 </span>            :       /**
<span class="lineNum">     821 </span>            :        *  @brief  Subscript access to the data contained in the %string.
<span class="lineNum">     822 </span>            :        *  @param  __pos  The index of the character to access.
<span class="lineNum">     823 </span>            :        *  @return  Read-only (constant) reference to the character.
<span class="lineNum">     824 </span>            :        *
<span class="lineNum">     825 </span>            :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">     826 </span>            :        *  Note that data access with this operator is unchecked and
<span class="lineNum">     827 </span>            :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">     828 </span>            :        *  see at().)
<span class="lineNum">     829 </span>            :        */
<span class="lineNum">     830 </span>            :       const_reference
<span class="lineNum">     831 </span>            :       operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
<span class="lineNum">     832 </span>            :       {
<span class="lineNum">     833 </span>            :         _GLIBCXX_DEBUG_ASSERT(__pos &lt;= size());
<span class="lineNum">     834 </span><span class="lineCov">  666835904 :         return _M_data()[__pos];</span>
<span class="lineNum">     835 </span>            :       }
<span class="lineNum">     836 </span>            : 
<span class="lineNum">     837 </span>            :       /**
<span class="lineNum">     838 </span>            :        *  @brief  Subscript access to the data contained in the %string.
<span class="lineNum">     839 </span>            :        *  @param  __pos  The index of the character to access.
<span class="lineNum">     840 </span>            :        *  @return  Read/write reference to the character.
<span class="lineNum">     841 </span>            :        *
<span class="lineNum">     842 </span>            :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">     843 </span>            :        *  Note that data access with this operator is unchecked and
<span class="lineNum">     844 </span>            :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">     845 </span>            :        *  see at().)
<span class="lineNum">     846 </span>            :        */
<span class="lineNum">     847 </span>            :       reference
<span class="lineNum">     848 </span>            :       operator[](size_type __pos)
<span class="lineNum">     849 </span>            :       {
<span class="lineNum">     850 </span>            :         // Allow pos == size() both in C++98 mode, as v3 extension,
<span class="lineNum">     851 </span>            :         // and in C++11 mode.
<span class="lineNum">     852 </span>            :         _GLIBCXX_DEBUG_ASSERT(__pos &lt;= size());
<span class="lineNum">     853 </span>            :         // In pedantic mode be strict in C++98 mode.
<span class="lineNum">     854 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__cplusplus &gt;= 201103L || __pos &lt; size());
<span class="lineNum">     855 </span><span class="lineNoCov">          0 :         return _M_data()[__pos];</span>
<span class="lineNum">     856 </span>            :       }
<span class="lineNum">     857 </span>            : 
<span class="lineNum">     858 </span>            :       /**
<span class="lineNum">     859 </span>            :        *  @brief  Provides access to the data contained in the %string.
<span class="lineNum">     860 </span>            :        *  @param __n The index of the character to access.
<span class="lineNum">     861 </span>            :        *  @return  Read-only (const) reference to the character.
<span class="lineNum">     862 </span>            :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">     863 </span>            :        *
<span class="lineNum">     864 </span>            :        *  This function provides for safer data access.  The parameter is
<span class="lineNum">     865 </span>            :        *  first checked that it is in the range of the string.  The function
<span class="lineNum">     866 </span>            :        *  throws out_of_range if the check fails.
<span class="lineNum">     867 </span>            :        */
<span class="lineNum">     868 </span>            :       const_reference
<span class="lineNum">     869 </span>            :       at(size_type __n) const
<span class="lineNum">     870 </span>            :       {
<span class="lineNum">     871 </span>            :         if (__n &gt;= this-&gt;size())
<span class="lineNum">     872 </span>            :           __throw_out_of_range_fmt(__N(&quot;basic_string::at: __n &quot;
<span class="lineNum">     873 </span>            :                                        &quot;(which is %zu) &gt;= this-&gt;size() &quot;
<span class="lineNum">     874 </span>            :                                        &quot;(which is %zu)&quot;),
<span class="lineNum">     875 </span>            :                                    __n, this-&gt;size());
<span class="lineNum">     876 </span>            :         return _M_data()[__n];
<span class="lineNum">     877 </span>            :       }
<span class="lineNum">     878 </span>            : 
<span class="lineNum">     879 </span>            :       /**
<span class="lineNum">     880 </span>            :        *  @brief  Provides access to the data contained in the %string.
<span class="lineNum">     881 </span>            :        *  @param __n The index of the character to access.
<span class="lineNum">     882 </span>            :        *  @return  Read/write reference to the character.
<span class="lineNum">     883 </span>            :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">     884 </span>            :        *
<span class="lineNum">     885 </span>            :        *  This function provides for safer data access.  The parameter is
<span class="lineNum">     886 </span>            :        *  first checked that it is in the range of the string.  The function
<span class="lineNum">     887 </span>            :        *  throws out_of_range if the check fails.
<span class="lineNum">     888 </span>            :        */
<span class="lineNum">     889 </span>            :       reference
<span class="lineNum">     890 </span>            :       at(size_type __n)
<span class="lineNum">     891 </span>            :       {
<span class="lineNum">     892 </span>            :         if (__n &gt;= size())
<span class="lineNum">     893 </span>            :           __throw_out_of_range_fmt(__N(&quot;basic_string::at: __n &quot;
<span class="lineNum">     894 </span>            :                                        &quot;(which is %zu) &gt;= this-&gt;size() &quot;
<span class="lineNum">     895 </span>            :                                        &quot;(which is %zu)&quot;),
<span class="lineNum">     896 </span>            :                                    __n, this-&gt;size());
<span class="lineNum">     897 </span>            :         return _M_data()[__n];
<span class="lineNum">     898 </span>            :       }
<span class="lineNum">     899 </span>            : 
<span class="lineNum">     900 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     901 </span>            :       /**
<span class="lineNum">     902 </span>            :        *  Returns a read/write reference to the data at the first
<span class="lineNum">     903 </span>            :        *  element of the %string.
<span class="lineNum">     904 </span>            :        */
<span class="lineNum">     905 </span>            :       reference
<span class="lineNum">     906 </span>            :       front() noexcept
<span class="lineNum">     907 </span>            :       { return operator[](0); }
<span class="lineNum">     908 </span>            : 
<span class="lineNum">     909 </span>            :       /**
<span class="lineNum">     910 </span>            :        *  Returns a read-only (constant) reference to the data at the first
<span class="lineNum">     911 </span>            :        *  element of the %string.
<span class="lineNum">     912 </span>            :        */
<span class="lineNum">     913 </span>            :       const_reference
<span class="lineNum">     914 </span>            :       front() const noexcept
<span class="lineNum">     915 </span>            :       { return operator[](0); }
<span class="lineNum">     916 </span>            : 
<span class="lineNum">     917 </span>            :       /**
<span class="lineNum">     918 </span>            :        *  Returns a read/write reference to the data at the last
<span class="lineNum">     919 </span>            :        *  element of the %string.
<span class="lineNum">     920 </span>            :        */
<span class="lineNum">     921 </span>            :       reference
<span class="lineNum">     922 </span>            :       back() noexcept
<span class="lineNum">     923 </span>            :       { return operator[](this-&gt;size() - 1); }
<span class="lineNum">     924 </span>            : 
<span class="lineNum">     925 </span>            :       /**
<span class="lineNum">     926 </span>            :        *  Returns a read-only (constant) reference to the data at the
<span class="lineNum">     927 </span>            :        *  last element of the %string.
<span class="lineNum">     928 </span>            :        */
<span class="lineNum">     929 </span>            :       const_reference
<span class="lineNum">     930 </span>            :       back() const noexcept
<span class="lineNum">     931 </span>            :       { return operator[](this-&gt;size() - 1); }
<span class="lineNum">     932 </span>            : #endif
<span class="lineNum">     933 </span>            : 
<span class="lineNum">     934 </span>            :       // Modifiers:
<span class="lineNum">     935 </span>            :       /**
<span class="lineNum">     936 </span>            :        *  @brief  Append a string to this string.
<span class="lineNum">     937 </span>            :        *  @param __str  The string to append.
<span class="lineNum">     938 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     939 </span>            :        */
<span class="lineNum">     940 </span>            :       basic_string&amp;
<span class="lineNum">     941 </span>            :       operator+=(const basic_string&amp; __str)
<span class="lineNum">     942 </span>            :       { return this-&gt;append(__str); }
<span class="lineNum">     943 </span>            : 
<span class="lineNum">     944 </span>            :       /**
<span class="lineNum">     945 </span>            :        *  @brief  Append a C string.
<span class="lineNum">     946 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">     947 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     948 </span>            :        */
<span class="lineNum">     949 </span>            :       basic_string&amp;
<span class="lineNum">     950 </span>            :       operator+=(const _CharT* __s)
<span class="lineNum">     951 </span><span class="lineNoCov">          0 :       { return this-&gt;append(__s); }</span>
<span class="lineNum">     952 </span>            : 
<span class="lineNum">     953 </span>            :       /**
<span class="lineNum">     954 </span>            :        *  @brief  Append a character.
<span class="lineNum">     955 </span>            :        *  @param __c  The character to append.
<span class="lineNum">     956 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     957 </span>            :        */
<span class="lineNum">     958 </span>            :       basic_string&amp;
<span class="lineNum">     959 </span>            :       operator+=(_CharT __c)
<span class="lineNum">     960 </span>            :       {
<span class="lineNum">     961 </span>            :         this-&gt;push_back(__c);
<span class="lineNum">     962 </span>            :         return *this;
<span class="lineNum">     963 </span>            :       }
<span class="lineNum">     964 </span>            : 
<span class="lineNum">     965 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     966 </span>            :       /**
<span class="lineNum">     967 </span>            :        *  @brief  Append an initializer_list of characters.
<span class="lineNum">     968 </span>            :        *  @param __l  The initializer_list of characters to be appended.
<span class="lineNum">     969 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     970 </span>            :        */
<span class="lineNum">     971 </span>            :       basic_string&amp;
<span class="lineNum">     972 </span>            :       operator+=(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">     973 </span>            :       { return this-&gt;append(__l.begin(), __l.size()); }
<span class="lineNum">     974 </span>            : #endif // C++11
<span class="lineNum">     975 </span>            : 
<span class="lineNum">     976 </span>            :       /**
<span class="lineNum">     977 </span>            :        *  @brief  Append a string to this string.
<span class="lineNum">     978 </span>            :        *  @param __str  The string to append.
<span class="lineNum">     979 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     980 </span>            :        */
<span class="lineNum">     981 </span>            :       basic_string&amp;
<span class="lineNum">     982 </span>            :       append(const basic_string&amp; __str)
<span class="lineNum">     983 </span><span class="lineCov">         11 :       { return _M_append(__str._M_data(), __str.size()); }</span>
<span class="lineNum">     984 </span>            : 
<span class="lineNum">     985 </span>            :       /**
<span class="lineNum">     986 </span>            :        *  @brief  Append a substring.
<span class="lineNum">     987 </span>            :        *  @param __str  The string to append.
<span class="lineNum">     988 </span>            :        *  @param __pos  Index of the first character of str to append.
<span class="lineNum">     989 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">     990 </span>            :        *  @return  Reference to this string.
<span class="lineNum">     991 </span>            :        *  @throw  std::out_of_range if @a __pos is not a valid index.
<span class="lineNum">     992 </span>            :        *
<span class="lineNum">     993 </span>            :        *  This function appends @a __n characters from @a __str
<span class="lineNum">     994 </span>            :        *  starting at @a __pos to this string.  If @a __n is is larger
<span class="lineNum">     995 </span>            :        *  than the number of available characters in @a __str, the
<span class="lineNum">     996 </span>            :        *  remainder of @a __str is appended.
<span class="lineNum">     997 </span>            :        */
<span class="lineNum">     998 </span>            :       basic_string&amp;
<span class="lineNum">     999 </span>            :       append(const basic_string&amp; __str, size_type __pos, size_type __n)
<span class="lineNum">    1000 </span>            :       { return _M_append(__str._M_data()
<span class="lineNum">    1001 </span>            :                          + __str._M_check(__pos, &quot;basic_string::append&quot;),
<span class="lineNum">    1002 </span>            :                          __str._M_limit(__pos, __n)); }
<span class="lineNum">    1003 </span>            : 
<span class="lineNum">    1004 </span>            :       /**
<span class="lineNum">    1005 </span>            :        *  @brief  Append a C substring.
<span class="lineNum">    1006 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">    1007 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">    1008 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1009 </span>            :        */
<span class="lineNum">    1010 </span>            :       basic_string&amp;
<span class="lineNum">    1011 </span>            :       append(const _CharT* __s, size_type __n)
<span class="lineNum">    1012 </span>            :       {
<span class="lineNum">    1013 </span>            :         __glibcxx_requires_string_len(__s, __n);
<span class="lineNum">    1014 </span>            :         _M_check_length(size_type(0), __n, &quot;basic_string::append&quot;);
<span class="lineNum">    1015 </span>            :         return _M_append(__s, __n);
<span class="lineNum">    1016 </span>            :       }
<span class="lineNum">    1017 </span>            : 
<span class="lineNum">    1018 </span>            :       /**
<span class="lineNum">    1019 </span>            :        *  @brief  Append a C string.
<span class="lineNum">    1020 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">    1021 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1022 </span>            :        */
<span class="lineNum">    1023 </span>            :       basic_string&amp;
<span class="lineNum">    1024 </span>            :       append(const _CharT* __s)
<span class="lineNum">    1025 </span>            :       {
<span class="lineNum">    1026 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1027 </span>            :         const size_type __n = traits_type::length(__s);
<span class="lineNum">    1028 </span>            :         _M_check_length(size_type(0), __n, &quot;basic_string::append&quot;);
<span class="lineNum">    1029 </span>            :         return _M_append(__s, __n);
<span class="lineNum">    1030 </span>            :       }
<span class="lineNum">    1031 </span>            : 
<span class="lineNum">    1032 </span>            :       /**
<span class="lineNum">    1033 </span>            :        *  @brief  Append multiple characters.
<span class="lineNum">    1034 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">    1035 </span>            :        *  @param __c  The character to use.
<span class="lineNum">    1036 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1037 </span>            :        *
<span class="lineNum">    1038 </span>            :        *  Appends __n copies of __c to this string.
<span class="lineNum">    1039 </span>            :        */
<span class="lineNum">    1040 </span>            :       basic_string&amp;
<span class="lineNum">    1041 </span>            :       append(size_type __n, _CharT __c)
<span class="lineNum">    1042 </span><span class="lineNoCov">          0 :       { return _M_replace_aux(this-&gt;size(), size_type(0), __n, __c); }</span>
<span class="lineNum">    1043 </span>            : 
<span class="lineNum">    1044 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1045 </span>            :       /**
<span class="lineNum">    1046 </span>            :        *  @brief  Append an initializer_list of characters.
<span class="lineNum">    1047 </span>            :        *  @param __l  The initializer_list of characters to append.
<span class="lineNum">    1048 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1049 </span>            :        */
<span class="lineNum">    1050 </span>            :       basic_string&amp;
<span class="lineNum">    1051 </span>            :       append(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    1052 </span>            :       { return this-&gt;append(__l.begin(), __l.size()); }
<span class="lineNum">    1053 </span>            : #endif // C++11
<span class="lineNum">    1054 </span>            : 
<span class="lineNum">    1055 </span>            :       /**
<span class="lineNum">    1056 </span>            :        *  @brief  Append a range of characters.
<span class="lineNum">    1057 </span>            :        *  @param __first  Iterator referencing the first character to append.
<span class="lineNum">    1058 </span>            :        *  @param __last  Iterator marking the end of the range.
<span class="lineNum">    1059 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1060 </span>            :        *
<span class="lineNum">    1061 </span>            :        *  Appends characters in the range [__first,__last) to this string.
<span class="lineNum">    1062 </span>            :        */
<span class="lineNum">    1063 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1064 </span>            :       template&lt;class _InputIterator,
<span class="lineNum">    1065 </span>            :                typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;
<span class="lineNum">    1066 </span>            : #else
<span class="lineNum">    1067 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    1068 </span>            : #endif
<span class="lineNum">    1069 </span>            :         basic_string&amp;
<span class="lineNum">    1070 </span>            :         append(_InputIterator __first, _InputIterator __last)
<span class="lineNum">    1071 </span>            :         { return this-&gt;replace(end(), end(), __first, __last); }
<span class="lineNum">    1072 </span>            : 
<span class="lineNum">    1073 </span>            :       /**
<span class="lineNum">    1074 </span>            :        *  @brief  Append a single character.
<span class="lineNum">    1075 </span>            :        *  @param __c  Character to append.
<span class="lineNum">    1076 </span>            :        */
<span class="lineNum">    1077 </span>            :       void
<span class="lineNum">    1078 </span>            :       push_back(_CharT __c)
<span class="lineNum">    1079 </span>            :       {
<span class="lineNum">    1080 </span>            :         const size_type __size = this-&gt;size();
<span class="lineNum">    1081 </span>            :         if (__size + 1 &gt; this-&gt;capacity())
<span class="lineNum">    1082 </span>            :           this-&gt;_M_mutate(__size, size_type(0), 0, size_type(1));
<span class="lineNum">    1083 </span>            :         traits_type::assign(this-&gt;_M_data()[__size], __c);
<span class="lineNum">    1084 </span>            :         this-&gt;_M_set_length(__size + 1);
<span class="lineNum">    1085 </span>            :       }
<span class="lineNum">    1086 </span>            : 
<span class="lineNum">    1087 </span>            :       /**
<span class="lineNum">    1088 </span>            :        *  @brief  Set value to contents of another string.
<span class="lineNum">    1089 </span>            :        *  @param  __str  Source string to use.
<span class="lineNum">    1090 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1091 </span>            :        */
<span class="lineNum">    1092 </span>            :       basic_string&amp;
<span class="lineNum">    1093 </span>            :       assign(const basic_string&amp; __str)
<span class="lineNum">    1094 </span>            :       {
<span class="lineNum">    1095 </span><span class="lineCov">        867 :         this-&gt;_M_assign(__str);</span>
<span class="lineNum">    1096 </span>            :         return *this;
<span class="lineNum">    1097 </span>            :       }
<span class="lineNum">    1098 </span>            : 
<span class="lineNum">    1099 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1100 </span>            :       /**
<span class="lineNum">    1101 </span>            :        *  @brief  Set value to contents of another string.
<span class="lineNum">    1102 </span>            :        *  @param  __str  Source string to use.
<span class="lineNum">    1103 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1104 </span>            :        *
<span class="lineNum">    1105 </span>            :        *  This function sets this string to the exact contents of @a __str.
<span class="lineNum">    1106 </span>            :        *  @a __str is a valid, but unspecified string.
<span class="lineNum">    1107 </span>            :        */
<span class="lineNum">    1108 </span>            :       basic_string&amp;
<span class="lineNum">    1109 </span>            :       assign(basic_string&amp;&amp; __str)
<span class="lineNum">    1110 </span>            :       {
<span class="lineNum">    1111 </span>            :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    1112 </span>            :         // 2063. Contradictory requirements for string move assignment
<span class="lineNum">    1113 </span>            :         return *this = std::move(__str);
<span class="lineNum">    1114 </span>            :       }
<span class="lineNum">    1115 </span>            : #endif // C++11
<span class="lineNum">    1116 </span>            : 
<span class="lineNum">    1117 </span>            :       /**
<span class="lineNum">    1118 </span>            :        *  @brief  Set value to a substring of a string.
<span class="lineNum">    1119 </span>            :        *  @param __str  The string to use.
<span class="lineNum">    1120 </span>            :        *  @param __pos  Index of the first character of str.
<span class="lineNum">    1121 </span>            :        *  @param __n  Number of characters to use.
<span class="lineNum">    1122 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1123 </span>            :        *  @throw  std::out_of_range if @a pos is not a valid index.
<span class="lineNum">    1124 </span>            :        *
<span class="lineNum">    1125 </span>            :        *  This function sets this string to the substring of @a __str
<span class="lineNum">    1126 </span>            :        *  consisting of @a __n characters at @a __pos.  If @a __n is
<span class="lineNum">    1127 </span>            :        *  is larger than the number of available characters in @a
<span class="lineNum">    1128 </span>            :        *  __str, the remainder of @a __str is used.
<span class="lineNum">    1129 </span>            :        */
<span class="lineNum">    1130 </span>            :       basic_string&amp;
<span class="lineNum">    1131 </span>            :       assign(const basic_string&amp; __str, size_type __pos, size_type __n)
<span class="lineNum">    1132 </span>            :       { return _M_replace(size_type(0), this-&gt;size(), __str._M_data()
<span class="lineNum">    1133 </span>            :                           + __str._M_check(__pos, &quot;basic_string::assign&quot;),
<span class="lineNum">    1134 </span>            :                           __str._M_limit(__pos, __n)); }
<span class="lineNum">    1135 </span>            : 
<span class="lineNum">    1136 </span>            :       /**
<span class="lineNum">    1137 </span>            :        *  @brief  Set value to a C substring.
<span class="lineNum">    1138 </span>            :        *  @param __s  The C string to use.
<span class="lineNum">    1139 </span>            :        *  @param __n  Number of characters to use.
<span class="lineNum">    1140 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1141 </span>            :        *
<span class="lineNum">    1142 </span>            :        *  This function sets the value of this string to the first @a __n
<span class="lineNum">    1143 </span>            :        *  characters of @a __s.  If @a __n is is larger than the number of
<span class="lineNum">    1144 </span>            :        *  available characters in @a __s, the remainder of @a __s is used.
<span class="lineNum">    1145 </span>            :        */
<span class="lineNum">    1146 </span>            :       basic_string&amp;
<span class="lineNum">    1147 </span>            :       assign(const _CharT* __s, size_type __n)
<span class="lineNum">    1148 </span>            :       {
<span class="lineNum">    1149 </span>            :         __glibcxx_requires_string_len(__s, __n);
<span class="lineNum">    1150 </span><span class="lineNoCov">          0 :         return _M_replace(size_type(0), this-&gt;size(), __s, __n);</span>
<span class="lineNum">    1151 </span>            :       }
<span class="lineNum">    1152 </span>            : 
<span class="lineNum">    1153 </span>            :       /**
<span class="lineNum">    1154 </span>            :        *  @brief  Set value to contents of a C string.
<span class="lineNum">    1155 </span>            :        *  @param __s  The C string to use.
<span class="lineNum">    1156 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1157 </span>            :        *
<span class="lineNum">    1158 </span>            :        *  This function sets the value of this string to the value of @a __s.
<span class="lineNum">    1159 </span>            :        *  The data is copied, so there is no dependence on @a __s once the
<span class="lineNum">    1160 </span>            :        *  function returns.
<span class="lineNum">    1161 </span>            :        */
<span class="lineNum">    1162 </span>            :       basic_string&amp;
<span class="lineNum">    1163 </span>            :       assign(const _CharT* __s)
<span class="lineNum">    1164 </span>            :       {
<span class="lineNum">    1165 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1166 </span>            :         return _M_replace(size_type(0), this-&gt;size(), __s,
<span class="lineNum">    1167 </span>            :                           traits_type::length(__s));
<span class="lineNum">    1168 </span>            :       }
<span class="lineNum">    1169 </span>            : 
<span class="lineNum">    1170 </span>            :       /**
<span class="lineNum">    1171 </span>            :        *  @brief  Set value to multiple characters.
<span class="lineNum">    1172 </span>            :        *  @param __n  Length of the resulting string.
<span class="lineNum">    1173 </span>            :        *  @param __c  The character to use.
<span class="lineNum">    1174 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1175 </span>            :        *
<span class="lineNum">    1176 </span>            :        *  This function sets the value of this string to @a __n copies of
<span class="lineNum">    1177 </span>            :        *  character @a __c.
<span class="lineNum">    1178 </span>            :        */
<span class="lineNum">    1179 </span>            :       basic_string&amp;
<span class="lineNum">    1180 </span>            :       assign(size_type __n, _CharT __c)
<span class="lineNum">    1181 </span>            :       { return _M_replace_aux(size_type(0), this-&gt;size(), __n, __c); }
<span class="lineNum">    1182 </span>            : 
<span class="lineNum">    1183 </span>            :       /**
<span class="lineNum">    1184 </span>            :        *  @brief  Set value to a range of characters.
<span class="lineNum">    1185 </span>            :        *  @param __first  Iterator referencing the first character to append.
<span class="lineNum">    1186 </span>            :        *  @param __last  Iterator marking the end of the range.
<span class="lineNum">    1187 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1188 </span>            :        *
<span class="lineNum">    1189 </span>            :        *  Sets value of string to characters in the range [__first,__last).
<span class="lineNum">    1190 </span>            :       */
<span class="lineNum">    1191 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1192 </span>            :       template&lt;class _InputIterator,
<span class="lineNum">    1193 </span>            :                typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;
<span class="lineNum">    1194 </span>            : #else
<span class="lineNum">    1195 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    1196 </span>            : #endif
<span class="lineNum">    1197 </span>            :         basic_string&amp;
<span class="lineNum">    1198 </span>            :         assign(_InputIterator __first, _InputIterator __last)
<span class="lineNum">    1199 </span>            :         { return this-&gt;replace(begin(), end(), __first, __last); }
<span class="lineNum">    1200 </span>            : 
<span class="lineNum">    1201 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1202 </span>            :       /**
<span class="lineNum">    1203 </span>            :        *  @brief  Set value to an initializer_list of characters.
<span class="lineNum">    1204 </span>            :        *  @param __l  The initializer_list of characters to assign.
<span class="lineNum">    1205 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1206 </span>            :        */
<span class="lineNum">    1207 </span>            :       basic_string&amp;
<span class="lineNum">    1208 </span>            :       assign(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    1209 </span>            :       { return this-&gt;assign(__l.begin(), __l.size()); }
<span class="lineNum">    1210 </span>            : #endif // C++11
<span class="lineNum">    1211 </span>            : 
<span class="lineNum">    1212 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1213 </span>            :       /**
<span class="lineNum">    1214 </span>            :        *  @brief  Insert multiple characters.
<span class="lineNum">    1215 </span>            :        *  @param __p  Const_iterator referencing location in string to
<span class="lineNum">    1216 </span>            :        *              insert at.
<span class="lineNum">    1217 </span>            :        *  @param __n  Number of characters to insert
<span class="lineNum">    1218 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    1219 </span>            :        *  @return  Iterator referencing the first inserted char.
<span class="lineNum">    1220 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1221 </span>            :        *
<span class="lineNum">    1222 </span>            :        *  Inserts @a __n copies of character @a __c starting at the
<span class="lineNum">    1223 </span>            :        *  position referenced by iterator @a __p.  If adding
<span class="lineNum">    1224 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    1225 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    1226 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1227 </span>            :       */
<span class="lineNum">    1228 </span>            :       iterator
<span class="lineNum">    1229 </span>            :       insert(const_iterator __p, size_type __n, _CharT __c)
<span class="lineNum">    1230 </span>            :       {
<span class="lineNum">    1231 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= begin() &amp;&amp; __p &lt;= end());
<span class="lineNum">    1232 </span>            :         const size_type __pos = __p - begin();
<span class="lineNum">    1233 </span>            :         this-&gt;replace(__p, __p, __n, __c);
<span class="lineNum">    1234 </span>            :         return iterator(this-&gt;_M_data() + __pos);
<span class="lineNum">    1235 </span>            :       }
<span class="lineNum">    1236 </span>            : #else
<span class="lineNum">    1237 </span>            :       /**
<span class="lineNum">    1238 </span>            :        *  @brief  Insert multiple characters.
<span class="lineNum">    1239 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    1240 </span>            :        *  @param __n  Number of characters to insert
<span class="lineNum">    1241 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    1242 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1243 </span>            :        *
<span class="lineNum">    1244 </span>            :        *  Inserts @a __n copies of character @a __c starting at the
<span class="lineNum">    1245 </span>            :        *  position referenced by iterator @a __p.  If adding
<span class="lineNum">    1246 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    1247 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    1248 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1249 </span>            :       */
<span class="lineNum">    1250 </span>            :       void
<span class="lineNum">    1251 </span>            :       insert(iterator __p, size_type __n, _CharT __c)
<span class="lineNum">    1252 </span>            :       { this-&gt;replace(__p, __p, __n, __c);  }
<span class="lineNum">    1253 </span>            : #endif
<span class="lineNum">    1254 </span>            : 
<span class="lineNum">    1255 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1256 </span>            :       /**
<span class="lineNum">    1257 </span>            :        *  @brief  Insert a range of characters.
<span class="lineNum">    1258 </span>            :        *  @param __p  Const_iterator referencing location in string to
<span class="lineNum">    1259 </span>            :        *              insert at.
<span class="lineNum">    1260 </span>            :        *  @param __beg  Start of range.
<span class="lineNum">    1261 </span>            :        *  @param __end  End of range.
<span class="lineNum">    1262 </span>            :        *  @return  Iterator referencing the first inserted char.
<span class="lineNum">    1263 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1264 </span>            :        *
<span class="lineNum">    1265 </span>            :        *  Inserts characters in range [beg,end).  If adding characters
<span class="lineNum">    1266 </span>            :        *  causes the length to exceed max_size(), length_error is
<span class="lineNum">    1267 </span>            :        *  thrown.  The value of the string doesn't change if an error
<span class="lineNum">    1268 </span>            :        *  is thrown.
<span class="lineNum">    1269 </span>            :       */
<span class="lineNum">    1270 </span>            :       template&lt;class _InputIterator,
<span class="lineNum">    1271 </span>            :                typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;
<span class="lineNum">    1272 </span>            :         iterator
<span class="lineNum">    1273 </span>            :         insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
<span class="lineNum">    1274 </span>            :         {
<span class="lineNum">    1275 </span>            :           _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= begin() &amp;&amp; __p &lt;= end());
<span class="lineNum">    1276 </span>            :           const size_type __pos = __p - begin();
<span class="lineNum">    1277 </span>            :           this-&gt;replace(__p, __p, __beg, __end);
<span class="lineNum">    1278 </span>            :           return iterator(this-&gt;_M_data() + __pos);
<span class="lineNum">    1279 </span>            :         }
<span class="lineNum">    1280 </span>            : #else
<span class="lineNum">    1281 </span>            :       /**
<span class="lineNum">    1282 </span>            :        *  @brief  Insert a range of characters.
<span class="lineNum">    1283 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    1284 </span>            :        *  @param __beg  Start of range.
<span class="lineNum">    1285 </span>            :        *  @param __end  End of range.
<span class="lineNum">    1286 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1287 </span>            :        *
<span class="lineNum">    1288 </span>            :        *  Inserts characters in range [__beg,__end).  If adding
<span class="lineNum">    1289 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    1290 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    1291 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1292 </span>            :       */
<span class="lineNum">    1293 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    1294 </span>            :         void
<span class="lineNum">    1295 </span>            :         insert(iterator __p, _InputIterator __beg, _InputIterator __end)
<span class="lineNum">    1296 </span>            :         { this-&gt;replace(__p, __p, __beg, __end); }
<span class="lineNum">    1297 </span>            : #endif
<span class="lineNum">    1298 </span>            : 
<span class="lineNum">    1299 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1300 </span>            :       /**
<span class="lineNum">    1301 </span>            :        *  @brief  Insert an initializer_list of characters.
<span class="lineNum">    1302 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    1303 </span>            :        *  @param __l  The initializer_list of characters to insert.
<span class="lineNum">    1304 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1305 </span>            :        */
<span class="lineNum">    1306 </span>            :       void
<span class="lineNum">    1307 </span>            :       insert(iterator __p, initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    1308 </span>            :       {
<span class="lineNum">    1309 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= begin() &amp;&amp; __p &lt;= end());
<span class="lineNum">    1310 </span>            :         this-&gt;insert(__p - begin(), __l.begin(), __l.size());
<span class="lineNum">    1311 </span>            :       }
<span class="lineNum">    1312 </span>            : #endif // C++11
<span class="lineNum">    1313 </span>            : 
<span class="lineNum">    1314 </span>            :       /**
<span class="lineNum">    1315 </span>            :        *  @brief  Insert value of a string.
<span class="lineNum">    1316 </span>            :        *  @param __pos1  Iterator referencing location in string to insert at.
<span class="lineNum">    1317 </span>            :        *  @param __str  The string to insert.
<span class="lineNum">    1318 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1319 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1320 </span>            :        *
<span class="lineNum">    1321 </span>            :        *  Inserts value of @a __str starting at @a __pos1.  If adding
<span class="lineNum">    1322 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    1323 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    1324 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1325 </span>            :       */
<span class="lineNum">    1326 </span>            :       basic_string&amp;
<span class="lineNum">    1327 </span>            :       insert(size_type __pos1, const basic_string&amp; __str)
<span class="lineNum">    1328 </span>            :       { return this-&gt;replace(__pos1, size_type(0),
<span class="lineNum">    1329 </span>            :                              __str._M_data(), __str.size()); }
<span class="lineNum">    1330 </span>            : 
<span class="lineNum">    1331 </span>            :       /**
<span class="lineNum">    1332 </span>            :        *  @brief  Insert a substring.
<span class="lineNum">    1333 </span>            :        *  @param __pos1  Iterator referencing location in string to insert at.
<span class="lineNum">    1334 </span>            :        *  @param __str  The string to insert.
<span class="lineNum">    1335 </span>            :        *  @param __pos2  Start of characters in str to insert.
<span class="lineNum">    1336 </span>            :        *  @param __n  Number of characters to insert.
<span class="lineNum">    1337 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1338 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1339 </span>            :        *  @throw  std::out_of_range  If @a pos1 &gt; size() or
<span class="lineNum">    1340 </span>            :        *  @a __pos2 &gt; @a str.size().
<span class="lineNum">    1341 </span>            :        *
<span class="lineNum">    1342 </span>            :        *  Starting at @a pos1, insert @a __n character of @a __str
<span class="lineNum">    1343 </span>            :        *  beginning with @a __pos2.  If adding characters causes the
<span class="lineNum">    1344 </span>            :        *  length to exceed max_size(), length_error is thrown.  If @a
<span class="lineNum">    1345 </span>            :        *  __pos1 is beyond the end of this string or @a __pos2 is
<span class="lineNum">    1346 </span>            :        *  beyond the end of @a __str, out_of_range is thrown.  The
<span class="lineNum">    1347 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    1348 </span>            :       */
<span class="lineNum">    1349 </span>            :       basic_string&amp;
<span class="lineNum">    1350 </span>            :       insert(size_type __pos1, const basic_string&amp; __str,
<span class="lineNum">    1351 </span>            :              size_type __pos2, size_type __n)
<span class="lineNum">    1352 </span>            :       { return this-&gt;replace(__pos1, size_type(0), __str._M_data()
<span class="lineNum">    1353 </span>            :                              + __str._M_check(__pos2, &quot;basic_string::insert&quot;),
<span class="lineNum">    1354 </span>            :                              __str._M_limit(__pos2, __n)); }
<span class="lineNum">    1355 </span>            : 
<span class="lineNum">    1356 </span>            :       /**
<span class="lineNum">    1357 </span>            :        *  @brief  Insert a C substring.
<span class="lineNum">    1358 </span>            :        *  @param __pos  Iterator referencing location in string to insert at.
<span class="lineNum">    1359 </span>            :        *  @param __s  The C string to insert.
<span class="lineNum">    1360 </span>            :        *  @param __n  The number of characters to insert.
<span class="lineNum">    1361 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1362 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1363 </span>            :        *  @throw  std::out_of_range  If @a __pos is beyond the end of this
<span class="lineNum">    1364 </span>            :        *  string.
<span class="lineNum">    1365 </span>            :        *
<span class="lineNum">    1366 </span>            :        *  Inserts the first @a __n characters of @a __s starting at @a
<span class="lineNum">    1367 </span>            :        *  __pos.  If adding characters causes the length to exceed
<span class="lineNum">    1368 </span>            :        *  max_size(), length_error is thrown.  If @a __pos is beyond
<span class="lineNum">    1369 </span>            :        *  end(), out_of_range is thrown.  The value of the string
<span class="lineNum">    1370 </span>            :        *  doesn't change if an error is thrown.
<span class="lineNum">    1371 </span>            :       */
<span class="lineNum">    1372 </span>            :       basic_string&amp;
<span class="lineNum">    1373 </span>            :       insert(size_type __pos, const _CharT* __s, size_type __n)
<span class="lineNum">    1374 </span>            :       { return this-&gt;replace(__pos, size_type(0), __s, __n); }
<span class="lineNum">    1375 </span>            : 
<span class="lineNum">    1376 </span>            :       /**
<span class="lineNum">    1377 </span>            :        *  @brief  Insert a C string.
<span class="lineNum">    1378 </span>            :        *  @param __pos  Iterator referencing location in string to insert at.
<span class="lineNum">    1379 </span>            :        *  @param __s  The C string to insert.
<span class="lineNum">    1380 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1381 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1382 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    1383 </span>            :        *  string.
<span class="lineNum">    1384 </span>            :        *
<span class="lineNum">    1385 </span>            :        *  Inserts the first @a n characters of @a __s starting at @a __pos.  If
<span class="lineNum">    1386 </span>            :        *  adding characters causes the length to exceed max_size(),
<span class="lineNum">    1387 </span>            :        *  length_error is thrown.  If @a __pos is beyond end(), out_of_range is
<span class="lineNum">    1388 </span>            :        *  thrown.  The value of the string doesn't change if an error is
<span class="lineNum">    1389 </span>            :        *  thrown.
<span class="lineNum">    1390 </span>            :       */
<span class="lineNum">    1391 </span>            :       basic_string&amp;
<span class="lineNum">    1392 </span>            :       insert(size_type __pos, const _CharT* __s)
<span class="lineNum">    1393 </span>            :       {
<span class="lineNum">    1394 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1395 </span>            :         return this-&gt;replace(__pos, size_type(0), __s,
<span class="lineNum">    1396 </span>            :                              traits_type::length(__s));
<span class="lineNum">    1397 </span>            :       }
<span class="lineNum">    1398 </span>            : 
<span class="lineNum">    1399 </span>            :       /**
<span class="lineNum">    1400 </span>            :        *  @brief  Insert multiple characters.
<span class="lineNum">    1401 </span>            :        *  @param __pos  Index in string to insert at.
<span class="lineNum">    1402 </span>            :        *  @param __n  Number of characters to insert
<span class="lineNum">    1403 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    1404 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1405 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1406 </span>            :        *  @throw  std::out_of_range  If @a __pos is beyond the end of this
<span class="lineNum">    1407 </span>            :        *  string.
<span class="lineNum">    1408 </span>            :        *
<span class="lineNum">    1409 </span>            :        *  Inserts @a __n copies of character @a __c starting at index
<span class="lineNum">    1410 </span>            :        *  @a __pos.  If adding characters causes the length to exceed
<span class="lineNum">    1411 </span>            :        *  max_size(), length_error is thrown.  If @a __pos &gt; length(),
<span class="lineNum">    1412 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    1413 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1414 </span>            :       */
<span class="lineNum">    1415 </span>            :       basic_string&amp;
<span class="lineNum">    1416 </span>            :       insert(size_type __pos, size_type __n, _CharT __c)
<span class="lineNum">    1417 </span>            :       { return _M_replace_aux(_M_check(__pos, &quot;basic_string::insert&quot;),
<span class="lineNum">    1418 </span>            :                               size_type(0), __n, __c); }
<span class="lineNum">    1419 </span>            : 
<span class="lineNum">    1420 </span>            :       /**
<span class="lineNum">    1421 </span>            :        *  @brief  Insert one character.
<span class="lineNum">    1422 </span>            :        *  @param __p  Iterator referencing position in string to insert at.
<span class="lineNum">    1423 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    1424 </span>            :        *  @return  Iterator referencing newly inserted char.
<span class="lineNum">    1425 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1426 </span>            :        *
<span class="lineNum">    1427 </span>            :        *  Inserts character @a __c at position referenced by @a __p.
<span class="lineNum">    1428 </span>            :        *  If adding character causes the length to exceed max_size(),
<span class="lineNum">    1429 </span>            :        *  length_error is thrown.  If @a __p is beyond end of string,
<span class="lineNum">    1430 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    1431 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1432 </span>            :       */
<span class="lineNum">    1433 </span>            :       iterator
<span class="lineNum">    1434 </span>            :       insert(__const_iterator __p, _CharT __c)
<span class="lineNum">    1435 </span>            :       {
<span class="lineNum">    1436 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= begin() &amp;&amp; __p &lt;= end());
<span class="lineNum">    1437 </span>            :         const size_type __pos = __p - begin();
<span class="lineNum">    1438 </span>            :         _M_replace_aux(__pos, size_type(0), size_type(1), __c);
<span class="lineNum">    1439 </span>            :         return iterator(_M_data() + __pos);
<span class="lineNum">    1440 </span>            :       }
<span class="lineNum">    1441 </span>            : 
<span class="lineNum">    1442 </span>            :       /**
<span class="lineNum">    1443 </span>            :        *  @brief  Remove characters.
<span class="lineNum">    1444 </span>            :        *  @param __pos  Index of first character to remove (default 0).
<span class="lineNum">    1445 </span>            :        *  @param __n  Number of characters to remove (default remainder).
<span class="lineNum">    1446 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1447 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    1448 </span>            :        *  string.
<span class="lineNum">    1449 </span>            :        *
<span class="lineNum">    1450 </span>            :        *  Removes @a __n characters from this string starting at @a
<span class="lineNum">    1451 </span>            :        *  __pos.  The length of the string is reduced by @a __n.  If
<span class="lineNum">    1452 </span>            :        *  there are &lt; @a __n characters to remove, the remainder of
<span class="lineNum">    1453 </span>            :        *  the string is truncated.  If @a __p is beyond end of string,
<span class="lineNum">    1454 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    1455 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1456 </span>            :       */
<span class="lineNum">    1457 </span>            :       basic_string&amp;
<span class="lineNum">    1458 </span>            :       erase(size_type __pos = 0, size_type __n = npos)
<span class="lineNum">    1459 </span>            :       {
<span class="lineNum">    1460 </span>            :         this-&gt;_M_erase(_M_check(__pos, &quot;basic_string::erase&quot;),
<span class="lineNum">    1461 </span>            :                        _M_limit(__pos, __n));
<span class="lineNum">    1462 </span>            :         return *this;
<span class="lineNum">    1463 </span>            :       }
<span class="lineNum">    1464 </span>            : 
<span class="lineNum">    1465 </span>            :       /**
<span class="lineNum">    1466 </span>            :        *  @brief  Remove one character.
<span class="lineNum">    1467 </span>            :        *  @param __position  Iterator referencing the character to remove.
<span class="lineNum">    1468 </span>            :        *  @return  iterator referencing same location after removal.
<span class="lineNum">    1469 </span>            :        *
<span class="lineNum">    1470 </span>            :        *  Removes the character at @a __position from this string. The value
<span class="lineNum">    1471 </span>            :        *  of the string doesn't change if an error is thrown.
<span class="lineNum">    1472 </span>            :       */
<span class="lineNum">    1473 </span>            :       iterator
<span class="lineNum">    1474 </span>            :       erase(__const_iterator __position)
<span class="lineNum">    1475 </span>            :       {
<span class="lineNum">    1476 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__position &gt;= begin()
<span class="lineNum">    1477 </span>            :                                  &amp;&amp; __position &lt; end());
<span class="lineNum">    1478 </span>            :         const size_type __pos = __position - begin();
<span class="lineNum">    1479 </span>            :         this-&gt;_M_erase(__pos, size_type(1));
<span class="lineNum">    1480 </span>            :         return iterator(_M_data() + __pos);
<span class="lineNum">    1481 </span>            :       }
<span class="lineNum">    1482 </span>            : 
<span class="lineNum">    1483 </span>            :       /**
<span class="lineNum">    1484 </span>            :        *  @brief  Remove a range of characters.
<span class="lineNum">    1485 </span>            :        *  @param __first  Iterator referencing the first character to remove.
<span class="lineNum">    1486 </span>            :        *  @param __last  Iterator referencing the end of the range.
<span class="lineNum">    1487 </span>            :        *  @return  Iterator referencing location of first after removal.
<span class="lineNum">    1488 </span>            :        *
<span class="lineNum">    1489 </span>            :        *  Removes the characters in the range [first,last) from this string.
<span class="lineNum">    1490 </span>            :        *  The value of the string doesn't change if an error is thrown.
<span class="lineNum">    1491 </span>            :       */
<span class="lineNum">    1492 </span>            :       iterator
<span class="lineNum">    1493 </span>            :       erase(__const_iterator __first, __const_iterator __last)
<span class="lineNum">    1494 </span>            :       {
<span class="lineNum">    1495 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__first &gt;= begin() &amp;&amp; __first &lt;= __last
<span class="lineNum">    1496 </span>            :                                  &amp;&amp; __last &lt;= end());
<span class="lineNum">    1497 </span><span class="lineNoCov">          0 :         const size_type __pos = __first - begin();</span>
<span class="lineNum">    1498 </span><span class="lineNoCov">          0 :         this-&gt;_M_erase(__pos, __last - __first);</span>
<span class="lineNum">    1499 </span>            :         return iterator(this-&gt;_M_data() + __pos);
<span class="lineNum">    1500 </span>            :       }
<span class="lineNum">    1501 </span>            : 
<span class="lineNum">    1502 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1503 </span>            :       /**
<span class="lineNum">    1504 </span>            :        *  @brief  Remove the last character.
<span class="lineNum">    1505 </span>            :        *
<span class="lineNum">    1506 </span>            :        *  The string must be non-empty.
<span class="lineNum">    1507 </span>            :        */
<span class="lineNum">    1508 </span>            :       void
<span class="lineNum">    1509 </span>            :       pop_back() noexcept
<span class="lineNum">    1510 </span>            :       { _M_erase(size()-1, 1); }
<span class="lineNum">    1511 </span>            : #endif // C++11
<span class="lineNum">    1512 </span>            : 
<span class="lineNum">    1513 </span>            :       /**
<span class="lineNum">    1514 </span>            :        *  @brief  Replace characters with value from another string.
<span class="lineNum">    1515 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    1516 </span>            :        *  @param __n  Number of characters to be replaced.
<span class="lineNum">    1517 </span>            :        *  @param __str  String to insert.
<span class="lineNum">    1518 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1519 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    1520 </span>            :        *  string.
<span class="lineNum">    1521 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1522 </span>            :        *
<span class="lineNum">    1523 </span>            :        *  Removes the characters in the range [__pos,__pos+__n) from
<span class="lineNum">    1524 </span>            :        *  this string.  In place, the value of @a __str is inserted.
<span class="lineNum">    1525 </span>            :        *  If @a __pos is beyond end of string, out_of_range is thrown.
<span class="lineNum">    1526 </span>            :        *  If the length of the result exceeds max_size(), length_error
<span class="lineNum">    1527 </span>            :        *  is thrown.  The value of the string doesn't change if an
<span class="lineNum">    1528 </span>            :        *  error is thrown.
<span class="lineNum">    1529 </span>            :       */
<span class="lineNum">    1530 </span>            :       basic_string&amp;
<span class="lineNum">    1531 </span>            :       replace(size_type __pos, size_type __n, const basic_string&amp; __str)
<span class="lineNum">    1532 </span>            :       { return this-&gt;replace(__pos, __n, __str._M_data(), __str.size()); }
<span class="lineNum">    1533 </span>            : 
<span class="lineNum">    1534 </span>            :       /**
<span class="lineNum">    1535 </span>            :        *  @brief  Replace characters with value from another string.
<span class="lineNum">    1536 </span>            :        *  @param __pos1  Index of first character to replace.
<span class="lineNum">    1537 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    1538 </span>            :        *  @param __str  String to insert.
<span class="lineNum">    1539 </span>            :        *  @param __pos2  Index of first character of str to use.
<span class="lineNum">    1540 </span>            :        *  @param __n2  Number of characters from str to use.
<span class="lineNum">    1541 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1542 </span>            :        *  @throw  std::out_of_range  If @a __pos1 &gt; size() or @a __pos2 &gt;
<span class="lineNum">    1543 </span>            :        *  __str.size().
<span class="lineNum">    1544 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1545 </span>            :        *
<span class="lineNum">    1546 </span>            :        *  Removes the characters in the range [__pos1,__pos1 + n) from this
<span class="lineNum">    1547 </span>            :        *  string.  In place, the value of @a __str is inserted.  If @a __pos is
<span class="lineNum">    1548 </span>            :        *  beyond end of string, out_of_range is thrown.  If the length of the
<span class="lineNum">    1549 </span>            :        *  result exceeds max_size(), length_error is thrown.  The value of the
<span class="lineNum">    1550 </span>            :        *  string doesn't change if an error is thrown.
<span class="lineNum">    1551 </span>            :       */
<span class="lineNum">    1552 </span>            :       basic_string&amp;
<span class="lineNum">    1553 </span>            :       replace(size_type __pos1, size_type __n1, const basic_string&amp; __str,
<span class="lineNum">    1554 </span>            :               size_type __pos2, size_type __n2)
<span class="lineNum">    1555 </span>            :       { return this-&gt;replace(__pos1, __n1, __str._M_data()
<span class="lineNum">    1556 </span>            :                              + __str._M_check(__pos2, &quot;basic_string::replace&quot;),
<span class="lineNum">    1557 </span>            :                              __str._M_limit(__pos2, __n2)); }
<span class="lineNum">    1558 </span>            : 
<span class="lineNum">    1559 </span>            :       /**
<span class="lineNum">    1560 </span>            :        *  @brief  Replace characters with value of a C substring.
<span class="lineNum">    1561 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    1562 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    1563 </span>            :        *  @param __s  C string to insert.
<span class="lineNum">    1564 </span>            :        *  @param __n2  Number of characters from @a s to use.
<span class="lineNum">    1565 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1566 </span>            :        *  @throw  std::out_of_range  If @a pos1 &gt; size().
<span class="lineNum">    1567 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1568 </span>            :        *
<span class="lineNum">    1569 </span>            :        *  Removes the characters in the range [__pos,__pos + __n1)
<span class="lineNum">    1570 </span>            :        *  from this string.  In place, the first @a __n2 characters of
<span class="lineNum">    1571 </span>            :        *  @a __s are inserted, or all of @a __s if @a __n2 is too large.  If
<span class="lineNum">    1572 </span>            :        *  @a __pos is beyond end of string, out_of_range is thrown.  If
<span class="lineNum">    1573 </span>            :        *  the length of result exceeds max_size(), length_error is
<span class="lineNum">    1574 </span>            :        *  thrown.  The value of the string doesn't change if an error
<span class="lineNum">    1575 </span>            :        *  is thrown.
<span class="lineNum">    1576 </span>            :       */
<span class="lineNum">    1577 </span>            :       basic_string&amp;
<span class="lineNum">    1578 </span>            :       replace(size_type __pos, size_type __n1, const _CharT* __s,
<span class="lineNum">    1579 </span>            :               size_type __n2)
<span class="lineNum">    1580 </span>            :       {
<span class="lineNum">    1581 </span>            :         __glibcxx_requires_string_len(__s, __n2);
<span class="lineNum">    1582 </span>            :         return _M_replace(_M_check(__pos, &quot;basic_string::replace&quot;),
<span class="lineNum">    1583 </span>            :                           _M_limit(__pos, __n1), __s, __n2);
<span class="lineNum">    1584 </span>            :       }
<span class="lineNum">    1585 </span>            : 
<span class="lineNum">    1586 </span>            :       /**
<span class="lineNum">    1587 </span>            :        *  @brief  Replace characters with value of a C string.
<span class="lineNum">    1588 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    1589 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    1590 </span>            :        *  @param __s  C string to insert.
<span class="lineNum">    1591 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1592 </span>            :        *  @throw  std::out_of_range  If @a pos &gt; size().
<span class="lineNum">    1593 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1594 </span>            :        *
<span class="lineNum">    1595 </span>            :        *  Removes the characters in the range [__pos,__pos + __n1)
<span class="lineNum">    1596 </span>            :        *  from this string.  In place, the characters of @a __s are
<span class="lineNum">    1597 </span>            :        *  inserted.  If @a __pos is beyond end of string, out_of_range
<span class="lineNum">    1598 </span>            :        *  is thrown.  If the length of result exceeds max_size(),
<span class="lineNum">    1599 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    1600 </span>            :        *  change if an error is thrown.
<span class="lineNum">    1601 </span>            :       */
<span class="lineNum">    1602 </span>            :       basic_string&amp;
<span class="lineNum">    1603 </span>            :       replace(size_type __pos, size_type __n1, const _CharT* __s)
<span class="lineNum">    1604 </span>            :       {
<span class="lineNum">    1605 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1606 </span>            :         return this-&gt;replace(__pos, __n1, __s, traits_type::length(__s));
<span class="lineNum">    1607 </span>            :       }
<span class="lineNum">    1608 </span>            : 
<span class="lineNum">    1609 </span>            :       /**
<span class="lineNum">    1610 </span>            :        *  @brief  Replace characters with multiple characters.
<span class="lineNum">    1611 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    1612 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    1613 </span>            :        *  @param __n2  Number of characters to insert.
<span class="lineNum">    1614 </span>            :        *  @param __c  Character to insert.
<span class="lineNum">    1615 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1616 </span>            :        *  @throw  std::out_of_range  If @a __pos &gt; size().
<span class="lineNum">    1617 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1618 </span>            :        *
<span class="lineNum">    1619 </span>            :        *  Removes the characters in the range [pos,pos + n1) from this
<span class="lineNum">    1620 </span>            :        *  string.  In place, @a __n2 copies of @a __c are inserted.
<span class="lineNum">    1621 </span>            :        *  If @a __pos is beyond end of string, out_of_range is thrown.
<span class="lineNum">    1622 </span>            :        *  If the length of result exceeds max_size(), length_error is
<span class="lineNum">    1623 </span>            :        *  thrown.  The value of the string doesn't change if an error
<span class="lineNum">    1624 </span>            :        *  is thrown.
<span class="lineNum">    1625 </span>            :       */
<span class="lineNum">    1626 </span>            :       basic_string&amp;
<span class="lineNum">    1627 </span>            :       replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
<span class="lineNum">    1628 </span>            :       { return _M_replace_aux(_M_check(__pos, &quot;basic_string::replace&quot;),
<span class="lineNum">    1629 </span>            :                               _M_limit(__pos, __n1), __n2, __c); }
<span class="lineNum">    1630 </span>            : 
<span class="lineNum">    1631 </span>            :       /**
<span class="lineNum">    1632 </span>            :        *  @brief  Replace range of characters with string.
<span class="lineNum">    1633 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1634 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1635 </span>            :        *  @param __str  String value to insert.
<span class="lineNum">    1636 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1637 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1638 </span>            :        *
<span class="lineNum">    1639 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1640 </span>            :        *  the value of @a __str is inserted.  If the length of result
<span class="lineNum">    1641 </span>            :        *  exceeds max_size(), length_error is thrown.  The value of
<span class="lineNum">    1642 </span>            :        *  the string doesn't change if an error is thrown.
<span class="lineNum">    1643 </span>            :       */
<span class="lineNum">    1644 </span>            :       basic_string&amp;
<span class="lineNum">    1645 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1646 </span>            :               const basic_string&amp; __str)
<span class="lineNum">    1647 </span>            :       { return this-&gt;replace(__i1, __i2, __str._M_data(), __str.size()); }
<span class="lineNum">    1648 </span>            : 
<span class="lineNum">    1649 </span>            :       /**
<span class="lineNum">    1650 </span>            :        *  @brief  Replace range of characters with C substring.
<span class="lineNum">    1651 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1652 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1653 </span>            :        *  @param __s  C string value to insert.
<span class="lineNum">    1654 </span>            :        *  @param __n  Number of characters from s to insert.
<span class="lineNum">    1655 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1656 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1657 </span>            :        *
<span class="lineNum">    1658 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1659 </span>            :        *  the first @a __n characters of @a __s are inserted.  If the
<span class="lineNum">    1660 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    1661 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    1662 </span>            :        *  thrown.
<span class="lineNum">    1663 </span>            :       */
<span class="lineNum">    1664 </span>            :       basic_string&amp;
<span class="lineNum">    1665 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1666 </span>            :               const _CharT* __s, size_type __n)
<span class="lineNum">    1667 </span>            :       {
<span class="lineNum">    1668 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1669 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1670 </span>            :         return this-&gt;replace(__i1 - begin(), __i2 - __i1, __s, __n);
<span class="lineNum">    1671 </span>            :       }
<span class="lineNum">    1672 </span>            : 
<span class="lineNum">    1673 </span>            :       /**
<span class="lineNum">    1674 </span>            :        *  @brief  Replace range of characters with C string.
<span class="lineNum">    1675 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1676 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1677 </span>            :        *  @param __s  C string value to insert.
<span class="lineNum">    1678 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1679 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1680 </span>            :        *
<span class="lineNum">    1681 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1682 </span>            :        *  the characters of @a __s are inserted.  If the length of
<span class="lineNum">    1683 </span>            :        *  result exceeds max_size(), length_error is thrown.  The
<span class="lineNum">    1684 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    1685 </span>            :       */
<span class="lineNum">    1686 </span>            :       basic_string&amp;
<span class="lineNum">    1687 </span>            :       replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s)
<span class="lineNum">    1688 </span>            :       {
<span class="lineNum">    1689 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1690 </span>            :         return this-&gt;replace(__i1, __i2, __s, traits_type::length(__s));
<span class="lineNum">    1691 </span>            :       }
<span class="lineNum">    1692 </span>            : 
<span class="lineNum">    1693 </span>            :       /**
<span class="lineNum">    1694 </span>            :        *  @brief  Replace range of characters with multiple characters
<span class="lineNum">    1695 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1696 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1697 </span>            :        *  @param __n  Number of characters to insert.
<span class="lineNum">    1698 </span>            :        *  @param __c  Character to insert.
<span class="lineNum">    1699 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1700 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1701 </span>            :        *
<span class="lineNum">    1702 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1703 </span>            :        *  @a __n copies of @a __c are inserted.  If the length of
<span class="lineNum">    1704 </span>            :        *  result exceeds max_size(), length_error is thrown.  The
<span class="lineNum">    1705 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    1706 </span>            :       */
<span class="lineNum">    1707 </span>            :       basic_string&amp;
<span class="lineNum">    1708 </span>            :       replace(__const_iterator __i1, __const_iterator __i2, size_type __n,
<span class="lineNum">    1709 </span>            :               _CharT __c)
<span class="lineNum">    1710 </span>            :       {
<span class="lineNum">    1711 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1712 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1713 </span>            :         return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __c);
<span class="lineNum">    1714 </span>            :       }
<span class="lineNum">    1715 </span>            : 
<span class="lineNum">    1716 </span>            :       /**
<span class="lineNum">    1717 </span>            :        *  @brief  Replace range of characters with range.
<span class="lineNum">    1718 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1719 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1720 </span>            :        *  @param __k1  Iterator referencing start of range to insert.
<span class="lineNum">    1721 </span>            :        *  @param __k2  Iterator referencing end of range to insert.
<span class="lineNum">    1722 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1723 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1724 </span>            :        *
<span class="lineNum">    1725 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1726 </span>            :        *  characters in the range [__k1,__k2) are inserted.  If the
<span class="lineNum">    1727 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    1728 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    1729 </span>            :        *  thrown.
<span class="lineNum">    1730 </span>            :       */
<span class="lineNum">    1731 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1732 </span>            :       template&lt;class _InputIterator,
<span class="lineNum">    1733 </span>            :                typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;
<span class="lineNum">    1734 </span>            :         basic_string&amp;
<span class="lineNum">    1735 </span>            :         replace(const_iterator __i1, const_iterator __i2,
<span class="lineNum">    1736 </span>            :                 _InputIterator __k1, _InputIterator __k2)
<span class="lineNum">    1737 </span>            :         {
<span class="lineNum">    1738 </span>            :           _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1739 </span>            :                                    &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1740 </span>            :           __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1741 </span>            :           return this-&gt;_M_replace_dispatch(__i1, __i2, __k1, __k2,
<span class="lineNum">    1742 </span>            :                                            std::__false_type());
<span class="lineNum">    1743 </span>            :         }
<span class="lineNum">    1744 </span>            : #else
<span class="lineNum">    1745 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    1746 </span>            : #ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST
<span class="lineNum">    1747 </span>            :         typename __enable_if_not_native_iterator&lt;_InputIterator&gt;::__type
<span class="lineNum">    1748 </span>            : #else
<span class="lineNum">    1749 </span>            :         basic_string&amp;
<span class="lineNum">    1750 </span>            : #endif
<span class="lineNum">    1751 </span>            :         replace(iterator __i1, iterator __i2,
<span class="lineNum">    1752 </span>            :                 _InputIterator __k1, _InputIterator __k2)
<span class="lineNum">    1753 </span>            :         {
<span class="lineNum">    1754 </span>            :           _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1755 </span>            :                                    &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1756 </span>            :           __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1757 </span>            :           typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;
<span class="lineNum">    1758 </span>            :           return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
<span class="lineNum">    1759 </span>            :         }
<span class="lineNum">    1760 </span>            : #endif
<span class="lineNum">    1761 </span>            : 
<span class="lineNum">    1762 </span>            :       // Specializations for the common case of pointer and iterator:
<span class="lineNum">    1763 </span>            :       // useful to avoid the overhead of temporary buffering in _M_replace.
<span class="lineNum">    1764 </span>            :       basic_string&amp;
<span class="lineNum">    1765 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1766 </span>            :               _CharT* __k1, _CharT* __k2)
<span class="lineNum">    1767 </span>            :       {
<span class="lineNum">    1768 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1769 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1770 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1771 </span>            :         return this-&gt;replace(__i1 - begin(), __i2 - __i1,
<span class="lineNum">    1772 </span>            :                              __k1, __k2 - __k1);
<span class="lineNum">    1773 </span>            :       }
<span class="lineNum">    1774 </span>            : 
<span class="lineNum">    1775 </span>            :       basic_string&amp;
<span class="lineNum">    1776 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1777 </span>            :               const _CharT* __k1, const _CharT* __k2)
<span class="lineNum">    1778 </span>            :       {
<span class="lineNum">    1779 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1780 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1781 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1782 </span>            :         return this-&gt;replace(__i1 - begin(), __i2 - __i1,
<span class="lineNum">    1783 </span><span class="lineNoCov">          0 :                              __k1, __k2 - __k1);</span>
<span class="lineNum">    1784 </span>            :       }
<span class="lineNum">    1785 </span>            : 
<span class="lineNum">    1786 </span>            :       basic_string&amp;
<span class="lineNum">    1787 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1788 </span>            :               iterator __k1, iterator __k2)
<span class="lineNum">    1789 </span>            :       {
<span class="lineNum">    1790 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1791 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1792 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1793 </span>            :         return this-&gt;replace(__i1 - begin(), __i2 - __i1,
<span class="lineNum">    1794 </span>            :                              __k1.base(), __k2 - __k1);
<span class="lineNum">    1795 </span>            :       }
<span class="lineNum">    1796 </span>            : 
<span class="lineNum">    1797 </span>            :       basic_string&amp;
<span class="lineNum">    1798 </span>            :       replace(__const_iterator __i1, __const_iterator __i2,
<span class="lineNum">    1799 </span>            :               const_iterator __k1, const_iterator __k2)
<span class="lineNum">    1800 </span>            :       {
<span class="lineNum">    1801 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(begin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    1802 </span>            :                                  &amp;&amp; __i2 &lt;= end());
<span class="lineNum">    1803 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    1804 </span>            :         return this-&gt;replace(__i1 - begin(), __i2 - __i1,
<span class="lineNum">    1805 </span><span class="lineNoCov">          0 :                              __k1.base(), __k2 - __k1);</span>
<span class="lineNum">    1806 </span>            :       }
<span class="lineNum">    1807 </span>            : 
<span class="lineNum">    1808 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    1809 </span>            :       /**
<span class="lineNum">    1810 </span>            :        *  @brief  Replace range of characters with initializer_list.
<span class="lineNum">    1811 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    1812 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    1813 </span>            :        *  @param __l  The initializer_list of characters to insert.
<span class="lineNum">    1814 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    1815 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    1816 </span>            :        *
<span class="lineNum">    1817 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    1818 </span>            :        *  characters in the range [__k1,__k2) are inserted.  If the
<span class="lineNum">    1819 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    1820 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    1821 </span>            :        *  thrown.
<span class="lineNum">    1822 </span>            :       */
<span class="lineNum">    1823 </span>            :       basic_string&amp; replace(const_iterator __i1, const_iterator __i2,
<span class="lineNum">    1824 </span>            :                             initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    1825 </span>            :       { return this-&gt;replace(__i1, __i2, __l.begin(), __l.end()); }
<span class="lineNum">    1826 </span>            : #endif // C++11
<span class="lineNum">    1827 </span>            : 
<span class="lineNum">    1828 </span>            :     private:
<span class="lineNum">    1829 </span>            :       template&lt;class _Integer&gt;
<span class="lineNum">    1830 </span>            :         basic_string&amp;
<span class="lineNum">    1831 </span>            :         _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
<span class="lineNum">    1832 </span>            :                             _Integer __n, _Integer __val, __true_type)
<span class="lineNum">    1833 </span>            :         { return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __val); }
<span class="lineNum">    1834 </span>            : 
<span class="lineNum">    1835 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    1836 </span>            :         basic_string&amp;
<span class="lineNum">    1837 </span>            :         _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
<span class="lineNum">    1838 </span>            :                             _InputIterator __k1, _InputIterator __k2,
<span class="lineNum">    1839 </span>            :                             __false_type);
<span class="lineNum">    1840 </span>            : 
<span class="lineNum">    1841 </span>            :       basic_string&amp;
<span class="lineNum">    1842 </span>            :       _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
<span class="lineNum">    1843 </span>            :                      _CharT __c);
<span class="lineNum">    1844 </span>            : 
<span class="lineNum">    1845 </span>            :       basic_string&amp;
<span class="lineNum">    1846 </span>            :       _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
<span class="lineNum">    1847 </span>            :                  const size_type __len2);
<span class="lineNum">    1848 </span>            : 
<span class="lineNum">    1849 </span>            :       basic_string&amp;
<span class="lineNum">    1850 </span>            :       _M_append(const _CharT* __s, size_type __n);
<span class="lineNum">    1851 </span>            : 
<span class="lineNum">    1852 </span>            :     public:
<span class="lineNum">    1853 </span>            : 
<span class="lineNum">    1854 </span>            :       /**
<span class="lineNum">    1855 </span>            :        *  @brief  Copy substring into C string.
<span class="lineNum">    1856 </span>            :        *  @param __s  C string to copy value into.
<span class="lineNum">    1857 </span>            :        *  @param __n  Number of characters to copy.
<span class="lineNum">    1858 </span>            :        *  @param __pos  Index of first character to copy.
<span class="lineNum">    1859 </span>            :        *  @return  Number of characters actually copied
<span class="lineNum">    1860 </span>            :        *  @throw  std::out_of_range  If __pos &gt; size().
<span class="lineNum">    1861 </span>            :        *
<span class="lineNum">    1862 </span>            :        *  Copies up to @a __n characters starting at @a __pos into the
<span class="lineNum">    1863 </span>            :        *  C string @a __s.  If @a __pos is %greater than size(),
<span class="lineNum">    1864 </span>            :        *  out_of_range is thrown.
<span class="lineNum">    1865 </span>            :       */
<span class="lineNum">    1866 </span>            :       size_type
<span class="lineNum">    1867 </span>            :       copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
<span class="lineNum">    1868 </span>            : 
<span class="lineNum">    1869 </span>            :       /**
<span class="lineNum">    1870 </span>            :        *  @brief  Swap contents with another string.
<span class="lineNum">    1871 </span>            :        *  @param __s  String to swap with.
<span class="lineNum">    1872 </span>            :        *
<span class="lineNum">    1873 </span>            :        *  Exchanges the contents of this string with that of @a __s in constant
<span class="lineNum">    1874 </span>            :        *  time.
<span class="lineNum">    1875 </span>            :       */
<span class="lineNum">    1876 </span>            :       void
<span class="lineNum">    1877 </span>            :       swap(basic_string&amp; __s) _GLIBCXX_NOEXCEPT;
<span class="lineNum">    1878 </span>            : 
<span class="lineNum">    1879 </span>            :       // String operations:
<span class="lineNum">    1880 </span>            :       /**
<span class="lineNum">    1881 </span>            :        *  @brief  Return const pointer to null-terminated contents.
<span class="lineNum">    1882 </span>            :        *
<span class="lineNum">    1883 </span>            :        *  This is a handle to internal data.  Do not modify or dire things may
<span class="lineNum">    1884 </span>            :        *  happen.
<span class="lineNum">    1885 </span>            :       */
<span class="lineNum">    1886 </span>            :       const _CharT*
<span class="lineNum">    1887 </span>            :       c_str() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    1888 </span>            :       { return _M_data(); }
<span class="lineNum">    1889 </span>            : 
<span class="lineNum">    1890 </span>            :       /**
<span class="lineNum">    1891 </span>            :        *  @brief  Return const pointer to contents.
<span class="lineNum">    1892 </span>            :        *
<span class="lineNum">    1893 </span>            :        *  This is a handle to internal data.  Do not modify or dire things may
<span class="lineNum">    1894 </span>            :        *  happen.
<span class="lineNum">    1895 </span>            :       */
<span class="lineNum">    1896 </span>            :       const _CharT*
<span class="lineNum">    1897 </span>            :       data() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    1898 </span>            :       { return _M_data(); }
<span class="lineNum">    1899 </span>            : 
<span class="lineNum">    1900 </span>            :       /**
<span class="lineNum">    1901 </span>            :        *  @brief  Return copy of allocator used to construct this string.
<span class="lineNum">    1902 </span>            :       */
<span class="lineNum">    1903 </span>            :       allocator_type
<span class="lineNum">    1904 </span>            :       get_allocator() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    1905 </span>            :       { return _M_get_allocator(); }
<span class="lineNum">    1906 </span>            : 
<span class="lineNum">    1907 </span>            :       /**
<span class="lineNum">    1908 </span>            :        *  @brief  Find position of a C substring.
<span class="lineNum">    1909 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    1910 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    1911 </span>            :        *  @param __n  Number of characters from @a s to search for.
<span class="lineNum">    1912 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    1913 </span>            :        *
<span class="lineNum">    1914 </span>            :        *  Starting from @a __pos, searches forward for the first @a
<span class="lineNum">    1915 </span>            :        *  __n characters in @a __s within this string.  If found,
<span class="lineNum">    1916 </span>            :        *  returns the index where it begins.  If not found, returns
<span class="lineNum">    1917 </span>            :        *  npos.
<span class="lineNum">    1918 </span>            :       */
<span class="lineNum">    1919 </span>            :       size_type
<span class="lineNum">    1920 </span>            :       find(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    1921 </span>            : 
<span class="lineNum">    1922 </span>            :       /**
<span class="lineNum">    1923 </span>            :        *  @brief  Find position of a string.
<span class="lineNum">    1924 </span>            :        *  @param __str  String to locate.
<span class="lineNum">    1925 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    1926 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    1927 </span>            :        *
<span class="lineNum">    1928 </span>            :        *  Starting from @a __pos, searches forward for value of @a __str within
<span class="lineNum">    1929 </span>            :        *  this string.  If found, returns the index where it begins.  If not
<span class="lineNum">    1930 </span>            :        *  found, returns npos.
<span class="lineNum">    1931 </span>            :       */
<span class="lineNum">    1932 </span>            :       size_type
<span class="lineNum">    1933 </span>            :       find(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    1934 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    1935 </span>            :       { return this-&gt;find(__str.data(), __pos, __str.size()); }
<span class="lineNum">    1936 </span>            : 
<span class="lineNum">    1937 </span>            :       /**
<span class="lineNum">    1938 </span>            :        *  @brief  Find position of a C string.
<span class="lineNum">    1939 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    1940 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    1941 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    1942 </span>            :        *
<span class="lineNum">    1943 </span>            :        *  Starting from @a __pos, searches forward for the value of @a
<span class="lineNum">    1944 </span>            :        *  __s within this string.  If found, returns the index where
<span class="lineNum">    1945 </span>            :        *  it begins.  If not found, returns npos.
<span class="lineNum">    1946 </span>            :       */
<span class="lineNum">    1947 </span>            :       size_type
<span class="lineNum">    1948 </span>            :       find(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    1949 </span>            :       {
<span class="lineNum">    1950 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    1951 </span>            :         return this-&gt;find(__s, __pos, traits_type::length(__s));
<span class="lineNum">    1952 </span>            :       }
<span class="lineNum">    1953 </span>            : 
<span class="lineNum">    1954 </span>            :       /**
<span class="lineNum">    1955 </span>            :        *  @brief  Find position of a character.
<span class="lineNum">    1956 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    1957 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    1958 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    1959 </span>            :        *
<span class="lineNum">    1960 </span>            :        *  Starting from @a __pos, searches forward for @a __c within
<span class="lineNum">    1961 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    1962 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    1963 </span>            :       */
<span class="lineNum">    1964 </span>            :       size_type
<span class="lineNum">    1965 </span>            :       find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
<span class="lineNum">    1966 </span>            : 
<span class="lineNum">    1967 </span>            :       /**
<span class="lineNum">    1968 </span>            :        *  @brief  Find last position of a string.
<span class="lineNum">    1969 </span>            :        *  @param __str  String to locate.
<span class="lineNum">    1970 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    1971 </span>            :        *  @return  Index of start of last occurrence.
<span class="lineNum">    1972 </span>            :        *
<span class="lineNum">    1973 </span>            :        *  Starting from @a __pos, searches backward for value of @a
<span class="lineNum">    1974 </span>            :        *  __str within this string.  If found, returns the index where
<span class="lineNum">    1975 </span>            :        *  it begins.  If not found, returns npos.
<span class="lineNum">    1976 </span>            :       */
<span class="lineNum">    1977 </span>            :       size_type
<span class="lineNum">    1978 </span>            :       rfind(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    1979 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    1980 </span>            :       { return this-&gt;rfind(__str.data(), __pos, __str.size()); }
<span class="lineNum">    1981 </span>            : 
<span class="lineNum">    1982 </span>            :       /**
<span class="lineNum">    1983 </span>            :        *  @brief  Find last position of a C substring.
<span class="lineNum">    1984 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    1985 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    1986 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    1987 </span>            :        *  @return  Index of start of last occurrence.
<span class="lineNum">    1988 </span>            :        *
<span class="lineNum">    1989 </span>            :        *  Starting from @a __pos, searches backward for the first @a
<span class="lineNum">    1990 </span>            :        *  __n characters in @a __s within this string.  If found,
<span class="lineNum">    1991 </span>            :        *  returns the index where it begins.  If not found, returns
<span class="lineNum">    1992 </span>            :        *  npos.
<span class="lineNum">    1993 </span>            :       */
<span class="lineNum">    1994 </span>            :       size_type
<span class="lineNum">    1995 </span>            :       rfind(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    1996 </span>            : 
<span class="lineNum">    1997 </span>            :       /**
<span class="lineNum">    1998 </span>            :        *  @brief  Find last position of a C string.
<span class="lineNum">    1999 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    2000 </span>            :        *  @param __pos  Index of character to start search at (default end).
<span class="lineNum">    2001 </span>            :        *  @return  Index of start of  last occurrence.
<span class="lineNum">    2002 </span>            :        *
<span class="lineNum">    2003 </span>            :        *  Starting from @a __pos, searches backward for the value of
<span class="lineNum">    2004 </span>            :        *  @a __s within this string.  If found, returns the index
<span class="lineNum">    2005 </span>            :        *  where it begins.  If not found, returns npos.
<span class="lineNum">    2006 </span>            :       */
<span class="lineNum">    2007 </span>            :       size_type
<span class="lineNum">    2008 </span>            :       rfind(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    2009 </span>            :       {
<span class="lineNum">    2010 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    2011 </span>            :         return this-&gt;rfind(__s, __pos, traits_type::length(__s));
<span class="lineNum">    2012 </span>            :       }
<span class="lineNum">    2013 </span>            : 
<span class="lineNum">    2014 </span>            :       /**
<span class="lineNum">    2015 </span>            :        *  @brief  Find last position of a character.
<span class="lineNum">    2016 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    2017 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2018 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2019 </span>            :        *
<span class="lineNum">    2020 </span>            :        *  Starting from @a __pos, searches backward for @a __c within
<span class="lineNum">    2021 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    2022 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    2023 </span>            :       */
<span class="lineNum">    2024 </span>            :       size_type
<span class="lineNum">    2025 </span>            :       rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
<span class="lineNum">    2026 </span>            : 
<span class="lineNum">    2027 </span>            :       /**
<span class="lineNum">    2028 </span>            :        *  @brief  Find position of a character of string.
<span class="lineNum">    2029 </span>            :        *  @param __str  String containing characters to locate.
<span class="lineNum">    2030 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2031 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2032 </span>            :        *
<span class="lineNum">    2033 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    2034 </span>            :        *  characters of @a __str within this string.  If found,
<span class="lineNum">    2035 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    2036 </span>            :        *  npos.
<span class="lineNum">    2037 </span>            :       */
<span class="lineNum">    2038 </span>            :       size_type
<span class="lineNum">    2039 </span>            :       find_first_of(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    2040 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    2041 </span>            :       { return this-&gt;find_first_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    2042 </span>            : 
<span class="lineNum">    2043 </span>            :       /**
<span class="lineNum">    2044 </span>            :        *  @brief  Find position of a character of C substring.
<span class="lineNum">    2045 </span>            :        *  @param __s  String containing characters to locate.
<span class="lineNum">    2046 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    2047 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    2048 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2049 </span>            :        *
<span class="lineNum">    2050 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    2051 </span>            :        *  first @a __n characters of @a __s within this string.  If
<span class="lineNum">    2052 </span>            :        *  found, returns the index where it was found.  If not found,
<span class="lineNum">    2053 </span>            :        *  returns npos.
<span class="lineNum">    2054 </span>            :       */
<span class="lineNum">    2055 </span>            :       size_type
<span class="lineNum">    2056 </span>            :       find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    2057 </span>            : 
<span class="lineNum">    2058 </span>            :       /**
<span class="lineNum">    2059 </span>            :        *  @brief  Find position of a character of C string.
<span class="lineNum">    2060 </span>            :        *  @param __s  String containing characters to locate.
<span class="lineNum">    2061 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2062 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2063 </span>            :        *
<span class="lineNum">    2064 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    2065 </span>            :        *  characters of @a __s within this string.  If found, returns
<span class="lineNum">    2066 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    2067 </span>            :       */
<span class="lineNum">    2068 </span>            :       size_type
<span class="lineNum">    2069 </span>            :       find_first_of(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    2070 </span>            :       {
<span class="lineNum">    2071 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    2072 </span>            :         return this-&gt;find_first_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    2073 </span>            :       }
<span class="lineNum">    2074 </span>            : 
<span class="lineNum">    2075 </span>            :       /**
<span class="lineNum">    2076 </span>            :        *  @brief  Find position of a character.
<span class="lineNum">    2077 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    2078 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2079 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2080 </span>            :        *
<span class="lineNum">    2081 </span>            :        *  Starting from @a __pos, searches forward for the character
<span class="lineNum">    2082 </span>            :        *  @a __c within this string.  If found, returns the index
<span class="lineNum">    2083 </span>            :        *  where it was found.  If not found, returns npos.
<span class="lineNum">    2084 </span>            :        *
<span class="lineNum">    2085 </span>            :        *  Note: equivalent to find(__c, __pos).
<span class="lineNum">    2086 </span>            :       */
<span class="lineNum">    2087 </span>            :       size_type
<span class="lineNum">    2088 </span>            :       find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2089 </span>            :       { return this-&gt;find(__c, __pos); }
<span class="lineNum">    2090 </span>            : 
<span class="lineNum">    2091 </span>            :       /**
<span class="lineNum">    2092 </span>            :        *  @brief  Find last position of a character of string.
<span class="lineNum">    2093 </span>            :        *  @param __str  String containing characters to locate.
<span class="lineNum">    2094 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2095 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2096 </span>            :        *
<span class="lineNum">    2097 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    2098 </span>            :        *  characters of @a __str within this string.  If found,
<span class="lineNum">    2099 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    2100 </span>            :        *  npos.
<span class="lineNum">    2101 </span>            :       */
<span class="lineNum">    2102 </span>            :       size_type
<span class="lineNum">    2103 </span>            :       find_last_of(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    2104 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    2105 </span>            :       { return this-&gt;find_last_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    2106 </span>            : 
<span class="lineNum">    2107 </span>            :       /**
<span class="lineNum">    2108 </span>            :        *  @brief  Find last position of a character of C substring.
<span class="lineNum">    2109 </span>            :        *  @param __s  C string containing characters to locate.
<span class="lineNum">    2110 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    2111 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    2112 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2113 </span>            :        *
<span class="lineNum">    2114 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    2115 </span>            :        *  first @a __n characters of @a __s within this string.  If
<span class="lineNum">    2116 </span>            :        *  found, returns the index where it was found.  If not found,
<span class="lineNum">    2117 </span>            :        *  returns npos.
<span class="lineNum">    2118 </span>            :       */
<span class="lineNum">    2119 </span>            :       size_type
<span class="lineNum">    2120 </span>            :       find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    2121 </span>            : 
<span class="lineNum">    2122 </span>            :       /**
<span class="lineNum">    2123 </span>            :        *  @brief  Find last position of a character of C string.
<span class="lineNum">    2124 </span>            :        *  @param __s  C string containing characters to locate.
<span class="lineNum">    2125 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2126 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2127 </span>            :        *
<span class="lineNum">    2128 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    2129 </span>            :        *  characters of @a __s within this string.  If found, returns
<span class="lineNum">    2130 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    2131 </span>            :       */
<span class="lineNum">    2132 </span>            :       size_type
<span class="lineNum">    2133 </span>            :       find_last_of(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    2134 </span>            :       {
<span class="lineNum">    2135 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    2136 </span>            :         return this-&gt;find_last_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    2137 </span>            :       }
<span class="lineNum">    2138 </span>            : 
<span class="lineNum">    2139 </span>            :       /**
<span class="lineNum">    2140 </span>            :        *  @brief  Find last position of a character.
<span class="lineNum">    2141 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    2142 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2143 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2144 </span>            :        *
<span class="lineNum">    2145 </span>            :        *  Starting from @a __pos, searches backward for @a __c within
<span class="lineNum">    2146 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    2147 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    2148 </span>            :        *
<span class="lineNum">    2149 </span>            :        *  Note: equivalent to rfind(__c, __pos).
<span class="lineNum">    2150 </span>            :       */
<span class="lineNum">    2151 </span>            :       size_type
<span class="lineNum">    2152 </span>            :       find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2153 </span><span class="lineNoCov">          0 :       { return this-&gt;rfind(__c, __pos); }</span>
<span class="lineNum">    2154 </span>            : 
<span class="lineNum">    2155 </span>            :       /**
<span class="lineNum">    2156 </span>            :        *  @brief  Find position of a character not in string.
<span class="lineNum">    2157 </span>            :        *  @param __str  String containing characters to avoid.
<span class="lineNum">    2158 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2159 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2160 </span>            :        *
<span class="lineNum">    2161 </span>            :        *  Starting from @a __pos, searches forward for a character not contained
<span class="lineNum">    2162 </span>            :        *  in @a __str within this string.  If found, returns the index where it
<span class="lineNum">    2163 </span>            :        *  was found.  If not found, returns npos.
<span class="lineNum">    2164 </span>            :       */
<span class="lineNum">    2165 </span>            :       size_type
<span class="lineNum">    2166 </span>            :       find_first_not_of(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    2167 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    2168 </span>            :       { return this-&gt;find_first_not_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    2169 </span>            : 
<span class="lineNum">    2170 </span>            :       /**
<span class="lineNum">    2171 </span>            :        *  @brief  Find position of a character not in C substring.
<span class="lineNum">    2172 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    2173 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    2174 </span>            :        *  @param __n  Number of characters from __s to consider.
<span class="lineNum">    2175 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2176 </span>            :        *
<span class="lineNum">    2177 </span>            :        *  Starting from @a __pos, searches forward for a character not
<span class="lineNum">    2178 </span>            :        *  contained in the first @a __n characters of @a __s within
<span class="lineNum">    2179 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    2180 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    2181 </span>            :       */
<span class="lineNum">    2182 </span>            :       size_type
<span class="lineNum">    2183 </span>            :       find_first_not_of(const _CharT* __s, size_type __pos,
<span class="lineNum">    2184 </span>            :                         size_type __n) const;
<span class="lineNum">    2185 </span>            : 
<span class="lineNum">    2186 </span>            :       /**
<span class="lineNum">    2187 </span>            :        *  @brief  Find position of a character not in C string.
<span class="lineNum">    2188 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    2189 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2190 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2191 </span>            :        *
<span class="lineNum">    2192 </span>            :        *  Starting from @a __pos, searches forward for a character not
<span class="lineNum">    2193 </span>            :        *  contained in @a __s within this string.  If found, returns
<span class="lineNum">    2194 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    2195 </span>            :       */
<span class="lineNum">    2196 </span>            :       size_type
<span class="lineNum">    2197 </span>            :       find_first_not_of(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    2198 </span>            :       {
<span class="lineNum">    2199 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    2200 </span>            :         return this-&gt;find_first_not_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    2201 </span>            :       }
<span class="lineNum">    2202 </span>            : 
<span class="lineNum">    2203 </span>            :       /**
<span class="lineNum">    2204 </span>            :        *  @brief  Find position of a different character.
<span class="lineNum">    2205 </span>            :        *  @param __c  Character to avoid.
<span class="lineNum">    2206 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    2207 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    2208 </span>            :        *
<span class="lineNum">    2209 </span>            :        *  Starting from @a __pos, searches forward for a character
<span class="lineNum">    2210 </span>            :        *  other than @a __c within this string.  If found, returns the
<span class="lineNum">    2211 </span>            :        *  index where it was found.  If not found, returns npos.
<span class="lineNum">    2212 </span>            :       */
<span class="lineNum">    2213 </span>            :       size_type
<span class="lineNum">    2214 </span>            :       find_first_not_of(_CharT __c, size_type __pos = 0) const
<span class="lineNum">    2215 </span>            :         _GLIBCXX_NOEXCEPT;
<span class="lineNum">    2216 </span>            : 
<span class="lineNum">    2217 </span>            :       /**
<span class="lineNum">    2218 </span>            :        *  @brief  Find last position of a character not in string.
<span class="lineNum">    2219 </span>            :        *  @param __str  String containing characters to avoid.
<span class="lineNum">    2220 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2221 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2222 </span>            :        *
<span class="lineNum">    2223 </span>            :        *  Starting from @a __pos, searches backward for a character
<span class="lineNum">    2224 </span>            :        *  not contained in @a __str within this string.  If found,
<span class="lineNum">    2225 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    2226 </span>            :        *  npos.
<span class="lineNum">    2227 </span>            :       */
<span class="lineNum">    2228 </span>            :       size_type
<span class="lineNum">    2229 </span>            :       find_last_not_of(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    2230 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    2231 </span>            :       { return this-&gt;find_last_not_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    2232 </span>            : 
<span class="lineNum">    2233 </span>            :       /**
<span class="lineNum">    2234 </span>            :        *  @brief  Find last position of a character not in C substring.
<span class="lineNum">    2235 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    2236 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    2237 </span>            :        *  @param __n  Number of characters from s to consider.
<span class="lineNum">    2238 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2239 </span>            :        *
<span class="lineNum">    2240 </span>            :        *  Starting from @a __pos, searches backward for a character not
<span class="lineNum">    2241 </span>            :        *  contained in the first @a __n characters of @a __s within this string.
<span class="lineNum">    2242 </span>            :        *  If found, returns the index where it was found.  If not found,
<span class="lineNum">    2243 </span>            :        *  returns npos.
<span class="lineNum">    2244 </span>            :       */
<span class="lineNum">    2245 </span>            :       size_type
<span class="lineNum">    2246 </span>            :       find_last_not_of(const _CharT* __s, size_type __pos,
<span class="lineNum">    2247 </span>            :                        size_type __n) const;
<span class="lineNum">    2248 </span>            :       /**
<span class="lineNum">    2249 </span>            :        *  @brief  Find last position of a character not in C string.
<span class="lineNum">    2250 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    2251 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2252 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2253 </span>            :        *
<span class="lineNum">    2254 </span>            :        *  Starting from @a __pos, searches backward for a character
<span class="lineNum">    2255 </span>            :        *  not contained in @a __s within this string.  If found,
<span class="lineNum">    2256 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    2257 </span>            :        *  npos.
<span class="lineNum">    2258 </span>            :       */
<span class="lineNum">    2259 </span>            :       size_type
<span class="lineNum">    2260 </span>            :       find_last_not_of(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    2261 </span>            :       {
<span class="lineNum">    2262 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    2263 </span>            :         return this-&gt;find_last_not_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    2264 </span>            :       }
<span class="lineNum">    2265 </span>            : 
<span class="lineNum">    2266 </span>            :       /**
<span class="lineNum">    2267 </span>            :        *  @brief  Find last position of a different character.
<span class="lineNum">    2268 </span>            :        *  @param __c  Character to avoid.
<span class="lineNum">    2269 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    2270 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    2271 </span>            :        *
<span class="lineNum">    2272 </span>            :        *  Starting from @a __pos, searches backward for a character other than
<span class="lineNum">    2273 </span>            :        *  @a __c within this string.  If found, returns the index where it was
<span class="lineNum">    2274 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    2275 </span>            :       */
<span class="lineNum">    2276 </span>            :       size_type
<span class="lineNum">    2277 </span>            :       find_last_not_of(_CharT __c, size_type __pos = npos) const
<span class="lineNum">    2278 </span>            :         _GLIBCXX_NOEXCEPT;
<span class="lineNum">    2279 </span>            : 
<span class="lineNum">    2280 </span>            :       /**
<span class="lineNum">    2281 </span>            :        *  @brief  Get a substring.
<span class="lineNum">    2282 </span>            :        *  @param __pos  Index of first character (default 0).
<span class="lineNum">    2283 </span>            :        *  @param __n  Number of characters in substring (default remainder).
<span class="lineNum">    2284 </span>            :        *  @return  The new string.
<span class="lineNum">    2285 </span>            :        *  @throw  std::out_of_range  If __pos &gt; size().
<span class="lineNum">    2286 </span>            :        *
<span class="lineNum">    2287 </span>            :        *  Construct and return a new string using the @a __n
<span class="lineNum">    2288 </span>            :        *  characters starting at @a __pos.  If the string is too
<span class="lineNum">    2289 </span>            :        *  short, use the remainder of the characters.  If @a __pos is
<span class="lineNum">    2290 </span>            :        *  beyond the end of the string, out_of_range is thrown.
<span class="lineNum">    2291 </span>            :       */
<span class="lineNum">    2292 </span>            :       basic_string
<span class="lineNum">    2293 </span>            :       substr(size_type __pos = 0, size_type __n = npos) const
<span class="lineNum">    2294 </span>            :       { return basic_string(*this,
<span class="lineNum">    2295 </span>            :                             _M_check(__pos, &quot;basic_string::substr&quot;), __n); }
<span class="lineNum">    2296 </span>            : 
<span class="lineNum">    2297 </span>            :       /**
<span class="lineNum">    2298 </span>            :        *  @brief  Compare to a string.
<span class="lineNum">    2299 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    2300 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2301 </span>            :        *
<span class="lineNum">    2302 </span>            :        *  Returns an integer &lt; 0 if this string is ordered before @a
<span class="lineNum">    2303 </span>            :        *  __str, 0 if their values are equivalent, or &gt; 0 if this
<span class="lineNum">    2304 </span>            :        *  string is ordered after @a __str.  Determines the effective
<span class="lineNum">    2305 </span>            :        *  length rlen of the strings to compare as the smallest of
<span class="lineNum">    2306 </span>            :        *  size() and str.size().  The function then compares the two
<span class="lineNum">    2307 </span>            :        *  strings by calling traits::compare(data(), str.data(),rlen).
<span class="lineNum">    2308 </span>            :        *  If the result of the comparison is nonzero returns it,
<span class="lineNum">    2309 </span>            :        *  otherwise the shorter one is ordered first.
<span class="lineNum">    2310 </span>            :       */
<span class="lineNum">    2311 </span>            :       int
<span class="lineNum">    2312 </span>            :       compare(const basic_string&amp; __str) const
<span class="lineNum">    2313 </span>            :       {
<span class="lineNum">    2314 </span>            :         const size_type __size = this-&gt;size();
<span class="lineNum">    2315 </span>            :         const size_type __osize = __str.size();
<span class="lineNum">    2316 </span>            :         const size_type __len = std::min(__size, __osize);
<span class="lineNum">    2317 </span>            : 
<span class="lineNum">    2318 </span>            :         int __r = traits_type::compare(_M_data(), __str.data(), __len);
<span class="lineNum">    2319 </span>            :         if (!__r)
<span class="lineNum">    2320 </span>            :           __r = _S_compare(__size, __osize);
<span class="lineNum">    2321 </span>            :         return __r;
<span class="lineNum">    2322 </span>            :       }
<span class="lineNum">    2323 </span>            : 
<span class="lineNum">    2324 </span>            :       /**
<span class="lineNum">    2325 </span>            :        *  @brief  Compare substring to a string.
<span class="lineNum">    2326 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    2327 </span>            :        *  @param __n  Number of characters in substring.
<span class="lineNum">    2328 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    2329 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2330 </span>            :        *
<span class="lineNum">    2331 </span>            :        *  Form the substring of this string from the @a __n characters
<span class="lineNum">    2332 </span>            :        *  starting at @a __pos.  Returns an integer &lt; 0 if the
<span class="lineNum">    2333 </span>            :        *  substring is ordered before @a __str, 0 if their values are
<span class="lineNum">    2334 </span>            :        *  equivalent, or &gt; 0 if the substring is ordered after @a
<span class="lineNum">    2335 </span>            :        *  __str.  Determines the effective length rlen of the strings
<span class="lineNum">    2336 </span>            :        *  to compare as the smallest of the length of the substring
<span class="lineNum">    2337 </span>            :        *  and @a __str.size().  The function then compares the two
<span class="lineNum">    2338 </span>            :        *  strings by calling
<span class="lineNum">    2339 </span>            :        *  traits::compare(substring.data(),str.data(),rlen).  If the
<span class="lineNum">    2340 </span>            :        *  result of the comparison is nonzero returns it, otherwise
<span class="lineNum">    2341 </span>            :        *  the shorter one is ordered first.
<span class="lineNum">    2342 </span>            :       */
<span class="lineNum">    2343 </span>            :       int
<span class="lineNum">    2344 </span>            :       compare(size_type __pos, size_type __n, const basic_string&amp; __str) const;
<span class="lineNum">    2345 </span>            : 
<span class="lineNum">    2346 </span>            :       /**
<span class="lineNum">    2347 </span>            :        *  @brief  Compare substring to a substring.
<span class="lineNum">    2348 </span>            :        *  @param __pos1  Index of first character of substring.
<span class="lineNum">    2349 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    2350 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    2351 </span>            :        *  @param __pos2  Index of first character of substring of str.
<span class="lineNum">    2352 </span>            :        *  @param __n2  Number of characters in substring of str.
<span class="lineNum">    2353 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2354 </span>            :        *
<span class="lineNum">    2355 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    2356 </span>            :        *  characters starting at @a __pos1.  Form the substring of @a
<span class="lineNum">    2357 </span>            :        *  __str from the @a __n2 characters starting at @a __pos2.
<span class="lineNum">    2358 </span>            :        *  Returns an integer &lt; 0 if this substring is ordered before
<span class="lineNum">    2359 </span>            :        *  the substring of @a __str, 0 if their values are equivalent,
<span class="lineNum">    2360 </span>            :        *  or &gt; 0 if this substring is ordered after the substring of
<span class="lineNum">    2361 </span>            :        *  @a __str.  Determines the effective length rlen of the
<span class="lineNum">    2362 </span>            :        *  strings to compare as the smallest of the lengths of the
<span class="lineNum">    2363 </span>            :        *  substrings.  The function then compares the two strings by
<span class="lineNum">    2364 </span>            :        *  calling
<span class="lineNum">    2365 </span>            :        *  traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
<span class="lineNum">    2366 </span>            :        *  If the result of the comparison is nonzero returns it,
<span class="lineNum">    2367 </span>            :        *  otherwise the shorter one is ordered first.
<span class="lineNum">    2368 </span>            :       */
<span class="lineNum">    2369 </span>            :       int
<span class="lineNum">    2370 </span>            :       compare(size_type __pos1, size_type __n1, const basic_string&amp; __str,
<span class="lineNum">    2371 </span>            :               size_type __pos2, size_type __n2) const;
<span class="lineNum">    2372 </span>            : 
<span class="lineNum">    2373 </span>            :       /**
<span class="lineNum">    2374 </span>            :        *  @brief  Compare to a C string.
<span class="lineNum">    2375 </span>            :        *  @param __s  C string to compare against.
<span class="lineNum">    2376 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2377 </span>            :        *
<span class="lineNum">    2378 </span>            :        *  Returns an integer &lt; 0 if this string is ordered before @a __s, 0 if
<span class="lineNum">    2379 </span>            :        *  their values are equivalent, or &gt; 0 if this string is ordered after
<span class="lineNum">    2380 </span>            :        *  @a __s.  Determines the effective length rlen of the strings to
<span class="lineNum">    2381 </span>            :        *  compare as the smallest of size() and the length of a string
<span class="lineNum">    2382 </span>            :        *  constructed from @a __s.  The function then compares the two strings
<span class="lineNum">    2383 </span>            :        *  by calling traits::compare(data(),s,rlen).  If the result of the
<span class="lineNum">    2384 </span>            :        *  comparison is nonzero returns it, otherwise the shorter one is
<span class="lineNum">    2385 </span>            :        *  ordered first.
<span class="lineNum">    2386 </span>            :       */
<span class="lineNum">    2387 </span>            :       int
<span class="lineNum">    2388 </span>            :       compare(const _CharT* __s) const;
<span class="lineNum">    2389 </span>            : 
<span class="lineNum">    2390 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    2391 </span>            :       // 5 String::compare specification questionable
<span class="lineNum">    2392 </span>            :       /**
<span class="lineNum">    2393 </span>            :        *  @brief  Compare substring to a C string.
<span class="lineNum">    2394 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    2395 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    2396 </span>            :        *  @param __s  C string to compare against.
<span class="lineNum">    2397 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2398 </span>            :        *
<span class="lineNum">    2399 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    2400 </span>            :        *  characters starting at @a pos.  Returns an integer &lt; 0 if
<span class="lineNum">    2401 </span>            :        *  the substring is ordered before @a __s, 0 if their values
<span class="lineNum">    2402 </span>            :        *  are equivalent, or &gt; 0 if the substring is ordered after @a
<span class="lineNum">    2403 </span>            :        *  __s.  Determines the effective length rlen of the strings to
<span class="lineNum">    2404 </span>            :        *  compare as the smallest of the length of the substring and
<span class="lineNum">    2405 </span>            :        *  the length of a string constructed from @a __s.  The
<span class="lineNum">    2406 </span>            :        *  function then compares the two string by calling
<span class="lineNum">    2407 </span>            :        *  traits::compare(substring.data(),__s,rlen).  If the result of
<span class="lineNum">    2408 </span>            :        *  the comparison is nonzero returns it, otherwise the shorter
<span class="lineNum">    2409 </span>            :        *  one is ordered first.
<span class="lineNum">    2410 </span>            :       */
<span class="lineNum">    2411 </span>            :       int
<span class="lineNum">    2412 </span>            :       compare(size_type __pos, size_type __n1, const _CharT* __s) const;
<span class="lineNum">    2413 </span>            : 
<span class="lineNum">    2414 </span>            :       /**
<span class="lineNum">    2415 </span>            :        *  @brief  Compare substring against a character %array.
<span class="lineNum">    2416 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    2417 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    2418 </span>            :        *  @param __s  character %array to compare against.
<span class="lineNum">    2419 </span>            :        *  @param __n2  Number of characters of s.
<span class="lineNum">    2420 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    2421 </span>            :        *
<span class="lineNum">    2422 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    2423 </span>            :        *  characters starting at @a __pos.  Form a string from the
<span class="lineNum">    2424 </span>            :        *  first @a __n2 characters of @a __s.  Returns an integer &lt; 0
<span class="lineNum">    2425 </span>            :        *  if this substring is ordered before the string from @a __s,
<span class="lineNum">    2426 </span>            :        *  0 if their values are equivalent, or &gt; 0 if this substring
<span class="lineNum">    2427 </span>            :        *  is ordered after the string from @a __s.  Determines the
<span class="lineNum">    2428 </span>            :        *  effective length rlen of the strings to compare as the
<span class="lineNum">    2429 </span>            :        *  smallest of the length of the substring and @a __n2.  The
<span class="lineNum">    2430 </span>            :        *  function then compares the two strings by calling
<span class="lineNum">    2431 </span>            :        *  traits::compare(substring.data(),s,rlen).  If the result of
<span class="lineNum">    2432 </span>            :        *  the comparison is nonzero returns it, otherwise the shorter
<span class="lineNum">    2433 </span>            :        *  one is ordered first.
<span class="lineNum">    2434 </span>            :        *
<span class="lineNum">    2435 </span>            :        *  NB: s must have at least n2 characters, &amp;apos;\\0&amp;apos; has
<span class="lineNum">    2436 </span>            :        *  no special meaning.
<span class="lineNum">    2437 </span>            :       */
<span class="lineNum">    2438 </span>            :       int
<span class="lineNum">    2439 </span>            :       compare(size_type __pos, size_type __n1, const _CharT* __s,
<span class="lineNum">    2440 </span>            :               size_type __n2) const;
<span class="lineNum">    2441 </span>            :   };
<span class="lineNum">    2442 </span>            : _GLIBCXX_END_NAMESPACE_CXX11
<span class="lineNum">    2443 </span>            : #else  // !_GLIBCXX_USE_CXX11_ABI
<span class="lineNum">    2444 </span>            :   // Reference-counted COW string implentation
<span class="lineNum">    2445 </span>            : 
<span class="lineNum">    2446 </span>            :   /**
<span class="lineNum">    2447 </span>            :    *  @class basic_string basic_string.h &lt;string&gt;
<span class="lineNum">    2448 </span>            :    *  @brief  Managing sequences of characters and character-like objects.
<span class="lineNum">    2449 </span>            :    *
<span class="lineNum">    2450 </span>            :    *  @ingroup strings
<span class="lineNum">    2451 </span>            :    *  @ingroup sequences
<span class="lineNum">    2452 </span>            :    *
<span class="lineNum">    2453 </span>            :    *  @tparam _CharT  Type of character
<span class="lineNum">    2454 </span>            :    *  @tparam _Traits  Traits for character type, defaults to
<span class="lineNum">    2455 </span>            :    *                   char_traits&lt;_CharT&gt;.
<span class="lineNum">    2456 </span>            :    *  @tparam _Alloc  Allocator type, defaults to allocator&lt;_CharT&gt;.
<span class="lineNum">    2457 </span>            :    *
<span class="lineNum">    2458 </span>            :    *  Meets the requirements of a &lt;a href=&quot;tables.html#65&quot;&gt;container&lt;/a&gt;, a
<span class="lineNum">    2459 </span>            :    *  &lt;a href=&quot;tables.html#66&quot;&gt;reversible container&lt;/a&gt;, and a
<span class="lineNum">    2460 </span>            :    *  &lt;a href=&quot;tables.html#67&quot;&gt;sequence&lt;/a&gt;.  Of the
<span class="lineNum">    2461 </span>            :    *  &lt;a href=&quot;tables.html#68&quot;&gt;optional sequence requirements&lt;/a&gt;, only
<span class="lineNum">    2462 </span>            :    *  @c push_back, @c at, and @c %array access are supported.
<span class="lineNum">    2463 </span>            :    *
<span class="lineNum">    2464 </span>            :    *  @doctodo
<span class="lineNum">    2465 </span>            :    *
<span class="lineNum">    2466 </span>            :    *
<span class="lineNum">    2467 </span>            :    *  Documentation?  What's that?
<span class="lineNum">    2468 </span>            :    *  Nathan Myers &lt;ncm@cantrip.org&gt;.
<span class="lineNum">    2469 </span>            :    *
<span class="lineNum">    2470 </span>            :    *  A string looks like this:
<span class="lineNum">    2471 </span>            :    *
<span class="lineNum">    2472 </span>            :    *  @code
<span class="lineNum">    2473 </span>            :    *                                        [_Rep]
<span class="lineNum">    2474 </span>            :    *                                        _M_length
<span class="lineNum">    2475 </span>            :    *   [basic_string&lt;char_type&gt;]            _M_capacity
<span class="lineNum">    2476 </span>            :    *   _M_dataplus                          _M_refcount
<span class="lineNum">    2477 </span>            :    *   _M_p ----------------&gt;               unnamed array of char_type
<span class="lineNum">    2478 </span>            :    *  @endcode
<span class="lineNum">    2479 </span>            :    *
<span class="lineNum">    2480 </span>            :    *  Where the _M_p points to the first character in the string, and
<span class="lineNum">    2481 </span>            :    *  you cast it to a pointer-to-_Rep and subtract 1 to get a
<span class="lineNum">    2482 </span>            :    *  pointer to the header.
<span class="lineNum">    2483 </span>            :    *
<span class="lineNum">    2484 </span>            :    *  This approach has the enormous advantage that a string object
<span class="lineNum">    2485 </span>            :    *  requires only one allocation.  All the ugliness is confined
<span class="lineNum">    2486 </span>            :    *  within a single %pair of inline functions, which each compile to
<span class="lineNum">    2487 </span>            :    *  a single @a add instruction: _Rep::_M_data(), and
<span class="lineNum">    2488 </span>            :    *  string::_M_rep(); and the allocation function which gets a
<span class="lineNum">    2489 </span>            :    *  block of raw bytes and with room enough and constructs a _Rep
<span class="lineNum">    2490 </span>            :    *  object at the front.
<span class="lineNum">    2491 </span>            :    *
<span class="lineNum">    2492 </span>            :    *  The reason you want _M_data pointing to the character %array and
<span class="lineNum">    2493 </span>            :    *  not the _Rep is so that the debugger can see the string
<span class="lineNum">    2494 </span>            :    *  contents. (Probably we should add a non-inline member to get
<span class="lineNum">    2495 </span>            :    *  the _Rep for the debugger to use, so users can check the actual
<span class="lineNum">    2496 </span>            :    *  string length.)
<span class="lineNum">    2497 </span>            :    *
<span class="lineNum">    2498 </span>            :    *  Note that the _Rep object is a POD so that you can have a
<span class="lineNum">    2499 </span>            :    *  static &lt;em&gt;empty string&lt;/em&gt; _Rep object already @a constructed before
<span class="lineNum">    2500 </span>            :    *  static constructors have run.  The reference-count encoding is
<span class="lineNum">    2501 </span>            :    *  chosen so that a 0 indicates one reference, so you never try to
<span class="lineNum">    2502 </span>            :    *  destroy the empty-string _Rep object.
<span class="lineNum">    2503 </span>            :    *
<span class="lineNum">    2504 </span>            :    *  All but the last paragraph is considered pretty conventional
<span class="lineNum">    2505 </span>            :    *  for a C++ string implementation.
<span class="lineNum">    2506 </span>            :   */
<span class="lineNum">    2507 </span>            :   // 21.3  Template class basic_string
<span class="lineNum">    2508 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    2509 </span>            :     class basic_string
<span class="lineNum">    2510 </span>            :     {
<span class="lineNum">    2511 </span>            :       typedef typename _Alloc::template rebind&lt;_CharT&gt;::other _CharT_alloc_type;
<span class="lineNum">    2512 </span>            : 
<span class="lineNum">    2513 </span>            :       // Types:
<span class="lineNum">    2514 </span>            :     public:
<span class="lineNum">    2515 </span>            :       typedef _Traits                                       traits_type;
<span class="lineNum">    2516 </span>            :       typedef typename _Traits::char_type                   value_type;
<span class="lineNum">    2517 </span>            :       typedef _Alloc                                        allocator_type;
<span class="lineNum">    2518 </span>            :       typedef typename _CharT_alloc_type::size_type         size_type;
<span class="lineNum">    2519 </span>            :       typedef typename _CharT_alloc_type::difference_type   difference_type;
<span class="lineNum">    2520 </span>            :       typedef typename _CharT_alloc_type::reference         reference;
<span class="lineNum">    2521 </span>            :       typedef typename _CharT_alloc_type::const_reference   const_reference;
<span class="lineNum">    2522 </span>            :       typedef typename _CharT_alloc_type::pointer           pointer;
<span class="lineNum">    2523 </span>            :       typedef typename _CharT_alloc_type::const_pointer     const_pointer;
<span class="lineNum">    2524 </span>            :       typedef __gnu_cxx::__normal_iterator&lt;pointer, basic_string&gt;  iterator;
<span class="lineNum">    2525 </span>            :       typedef __gnu_cxx::__normal_iterator&lt;const_pointer, basic_string&gt;
<span class="lineNum">    2526 </span>            :                                                             const_iterator;
<span class="lineNum">    2527 </span>            :       typedef std::reverse_iterator&lt;const_iterator&gt;       const_reverse_iterator;
<span class="lineNum">    2528 </span>            :       typedef std::reverse_iterator&lt;iterator&gt;                 reverse_iterator;
<span class="lineNum">    2529 </span>            : 
<span class="lineNum">    2530 </span>            :     private:
<span class="lineNum">    2531 </span>            :       // _Rep: string representation
<span class="lineNum">    2532 </span>            :       //   Invariants:
<span class="lineNum">    2533 </span>            :       //   1. String really contains _M_length + 1 characters: due to 21.3.4
<span class="lineNum">    2534 </span>            :       //      must be kept null-terminated.
<span class="lineNum">    2535 </span>            :       //   2. _M_capacity &gt;= _M_length
<span class="lineNum">    2536 </span>            :       //      Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
<span class="lineNum">    2537 </span>            :       //   3. _M_refcount has three states:
<span class="lineNum">    2538 </span>            :       //      -1: leaked, one reference, no ref-copies allowed, non-const.
<span class="lineNum">    2539 </span>            :       //       0: one reference, non-const.
<span class="lineNum">    2540 </span>            :       //     n&gt;0: n + 1 references, operations require a lock, const.
<span class="lineNum">    2541 </span>            :       //   4. All fields==0 is an empty string, given the extra storage
<span class="lineNum">    2542 </span>            :       //      beyond-the-end for a null terminator; thus, the shared
<span class="lineNum">    2543 </span>            :       //      empty string representation needs no constructor.
<span class="lineNum">    2544 </span>            : 
<span class="lineNum">    2545 </span>            :       struct _Rep_base
<span class="lineNum">    2546 </span>            :       {
<span class="lineNum">    2547 </span>            :         size_type               _M_length;
<span class="lineNum">    2548 </span>            :         size_type               _M_capacity;
<span class="lineNum">    2549 </span>            :         _Atomic_word            _M_refcount;
<span class="lineNum">    2550 </span>            :       };
<span class="lineNum">    2551 </span>            : 
<span class="lineNum">    2552 </span>            :       struct _Rep : _Rep_base
<span class="lineNum">    2553 </span>            :       {
<span class="lineNum">    2554 </span>            :         // Types:
<span class="lineNum">    2555 </span>            :         typedef typename _Alloc::template rebind&lt;char&gt;::other _Raw_bytes_alloc;
<span class="lineNum">    2556 </span>            : 
<span class="lineNum">    2557 </span>            :         // (Public) Data members:
<span class="lineNum">    2558 </span>            : 
<span class="lineNum">    2559 </span>            :         // The maximum number of individual char_type elements of an
<span class="lineNum">    2560 </span>            :         // individual string is determined by _S_max_size. This is the
<span class="lineNum">    2561 </span>            :         // value that will be returned by max_size().  (Whereas npos
<span class="lineNum">    2562 </span>            :         // is the maximum number of bytes the allocator can allocate.)
<span class="lineNum">    2563 </span>            :         // If one was to divvy up the theoretical largest size string,
<span class="lineNum">    2564 </span>            :         // with a terminating character and m _CharT elements, it'd
<span class="lineNum">    2565 </span>            :         // look like this:
<span class="lineNum">    2566 </span>            :         // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
<span class="lineNum">    2567 </span>            :         // Solving for m:
<span class="lineNum">    2568 </span>            :         // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
<span class="lineNum">    2569 </span>            :         // In addition, this implementation quarters this amount.
<span class="lineNum">    2570 </span>            :         static const size_type  _S_max_size;
<span class="lineNum">    2571 </span>            :         static const _CharT     _S_terminal;
<span class="lineNum">    2572 </span>            : 
<span class="lineNum">    2573 </span>            :         // The following storage is init'd to 0 by the linker, resulting
<span class="lineNum">    2574 </span>            :         // (carefully) in an empty string with one reference.
<span class="lineNum">    2575 </span>            :         static size_type _S_empty_rep_storage[];
<span class="lineNum">    2576 </span>            : 
<span class="lineNum">    2577 </span>            :         static _Rep&amp;
<span class="lineNum">    2578 </span>            :         _S_empty_rep() _GLIBCXX_NOEXCEPT
<span class="lineNum">    2579 </span>            :         { 
<span class="lineNum">    2580 </span>            :           // NB: Mild hack to avoid strict-aliasing warnings.  Note that
<span class="lineNum">    2581 </span>            :           // _S_empty_rep_storage is never modified and the punning should
<span class="lineNum">    2582 </span>            :           // be reasonably safe in this case.
<span class="lineNum">    2583 </span>            :           void* __p = reinterpret_cast&lt;void*&gt;(&amp;_S_empty_rep_storage);
<span class="lineNum">    2584 </span>            :           return *reinterpret_cast&lt;_Rep*&gt;(__p);
<span class="lineNum">    2585 </span>            :         }
<span class="lineNum">    2586 </span>            : 
<span class="lineNum">    2587 </span>            :         bool
<span class="lineNum">    2588 </span>            :         _M_is_leaked() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2589 </span>            :         { return this-&gt;_M_refcount &lt; 0; }
<span class="lineNum">    2590 </span>            : 
<span class="lineNum">    2591 </span>            :         bool
<span class="lineNum">    2592 </span>            :         _M_is_shared() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2593 </span>            :         { return this-&gt;_M_refcount &gt; 0; }
<span class="lineNum">    2594 </span>            : 
<span class="lineNum">    2595 </span>            :         void
<span class="lineNum">    2596 </span>            :         _M_set_leaked() _GLIBCXX_NOEXCEPT
<span class="lineNum">    2597 </span>            :         { this-&gt;_M_refcount = -1; }
<span class="lineNum">    2598 </span>            : 
<span class="lineNum">    2599 </span>            :         void
<span class="lineNum">    2600 </span>            :         _M_set_sharable() _GLIBCXX_NOEXCEPT
<span class="lineNum">    2601 </span>            :         { this-&gt;_M_refcount = 0; }
<span class="lineNum">    2602 </span>            : 
<span class="lineNum">    2603 </span>            :         void
<span class="lineNum">    2604 </span>            :         _M_set_length_and_sharable(size_type __n) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2605 </span>            :         {
<span class="lineNum">    2606 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2607 </span>            :           if (__builtin_expect(this != &amp;_S_empty_rep(), false))
<span class="lineNum">    2608 </span>            : #endif
<span class="lineNum">    2609 </span>            :             {
<span class="lineNum">    2610 </span>            :               this-&gt;_M_set_sharable();  // One reference.
<span class="lineNum">    2611 </span>            :               this-&gt;_M_length = __n;
<span class="lineNum">    2612 </span>            :               traits_type::assign(this-&gt;_M_refdata()[__n], _S_terminal);
<span class="lineNum">    2613 </span>            :               // grrr. (per 21.3.4)
<span class="lineNum">    2614 </span>            :               // You cannot leave those LWG people alone for a second.
<span class="lineNum">    2615 </span>            :             }
<span class="lineNum">    2616 </span>            :         }
<span class="lineNum">    2617 </span>            : 
<span class="lineNum">    2618 </span>            :         _CharT*
<span class="lineNum">    2619 </span>            :         _M_refdata() throw()
<span class="lineNum">    2620 </span>            :         { return reinterpret_cast&lt;_CharT*&gt;(this + 1); }
<span class="lineNum">    2621 </span>            : 
<span class="lineNum">    2622 </span>            :         _CharT*
<span class="lineNum">    2623 </span>            :         _M_grab(const _Alloc&amp; __alloc1, const _Alloc&amp; __alloc2)
<span class="lineNum">    2624 </span>            :         {
<span class="lineNum">    2625 </span>            :           return (!_M_is_leaked() &amp;&amp; __alloc1 == __alloc2)
<span class="lineNum">    2626 </span>            :                   ? _M_refcopy() : _M_clone(__alloc1);
<span class="lineNum">    2627 </span>            :         }
<span class="lineNum">    2628 </span>            : 
<span class="lineNum">    2629 </span>            :         // Create &amp; Destroy
<span class="lineNum">    2630 </span>            :         static _Rep*
<span class="lineNum">    2631 </span>            :         _S_create(size_type, size_type, const _Alloc&amp;);
<span class="lineNum">    2632 </span>            : 
<span class="lineNum">    2633 </span>            :         void
<span class="lineNum">    2634 </span>            :         _M_dispose(const _Alloc&amp; __a) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2635 </span>            :         {
<span class="lineNum">    2636 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2637 </span>            :           if (__builtin_expect(this != &amp;_S_empty_rep(), false))
<span class="lineNum">    2638 </span>            : #endif
<span class="lineNum">    2639 </span>            :             {
<span class="lineNum">    2640 </span>            :               // Be race-detector-friendly.  For more info see bits/c++config.
<span class="lineNum">    2641 </span>            :               _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&amp;this-&gt;_M_refcount);
<span class="lineNum">    2642 </span>            :               if (__gnu_cxx::__exchange_and_add_dispatch(&amp;this-&gt;_M_refcount,
<span class="lineNum">    2643 </span>            :                                                          -1) &lt;= 0)
<span class="lineNum">    2644 </span>            :                 {
<span class="lineNum">    2645 </span>            :                   _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&amp;this-&gt;_M_refcount);
<span class="lineNum">    2646 </span>            :                   _M_destroy(__a);
<span class="lineNum">    2647 </span>            :                 }
<span class="lineNum">    2648 </span>            :             }
<span class="lineNum">    2649 </span>            :         }  // XXX MT
<span class="lineNum">    2650 </span>            : 
<span class="lineNum">    2651 </span>            :         void
<span class="lineNum">    2652 </span>            :         _M_destroy(const _Alloc&amp;) throw();
<span class="lineNum">    2653 </span>            : 
<span class="lineNum">    2654 </span>            :         _CharT*
<span class="lineNum">    2655 </span>            :         _M_refcopy() throw()
<span class="lineNum">    2656 </span>            :         {
<span class="lineNum">    2657 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2658 </span>            :           if (__builtin_expect(this != &amp;_S_empty_rep(), false))
<span class="lineNum">    2659 </span>            : #endif
<span class="lineNum">    2660 </span>            :             __gnu_cxx::__atomic_add_dispatch(&amp;this-&gt;_M_refcount, 1);
<span class="lineNum">    2661 </span>            :           return _M_refdata();
<span class="lineNum">    2662 </span>            :         }  // XXX MT
<span class="lineNum">    2663 </span>            : 
<span class="lineNum">    2664 </span>            :         _CharT*
<span class="lineNum">    2665 </span>            :         _M_clone(const _Alloc&amp;, size_type __res = 0);
<span class="lineNum">    2666 </span>            :       };
<span class="lineNum">    2667 </span>            : 
<span class="lineNum">    2668 </span>            :       // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
<span class="lineNum">    2669 </span>            :       struct _Alloc_hider : _Alloc
<span class="lineNum">    2670 </span>            :       {
<span class="lineNum">    2671 </span>            :         _Alloc_hider(_CharT* __dat, const _Alloc&amp; __a) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2672 </span>            :         : _Alloc(__a), _M_p(__dat) { }
<span class="lineNum">    2673 </span>            : 
<span class="lineNum">    2674 </span>            :         _CharT* _M_p; // The actual data.
<span class="lineNum">    2675 </span>            :       };
<span class="lineNum">    2676 </span>            : 
<span class="lineNum">    2677 </span>            :     public:
<span class="lineNum">    2678 </span>            :       // Data Members (public):
<span class="lineNum">    2679 </span>            :       // NB: This is an unsigned type, and thus represents the maximum
<span class="lineNum">    2680 </span>            :       // size that the allocator can hold.
<span class="lineNum">    2681 </span>            :       ///  Value returned by various member functions when they fail.
<span class="lineNum">    2682 </span>            :       static const size_type    npos = static_cast&lt;size_type&gt;(-1);
<span class="lineNum">    2683 </span>            : 
<span class="lineNum">    2684 </span>            :     private:
<span class="lineNum">    2685 </span>            :       // Data Members (private):
<span class="lineNum">    2686 </span>            :       mutable _Alloc_hider      _M_dataplus;
<span class="lineNum">    2687 </span>            : 
<span class="lineNum">    2688 </span>            :       _CharT*
<span class="lineNum">    2689 </span>            :       _M_data() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2690 </span>            :       { return  _M_dataplus._M_p; }
<span class="lineNum">    2691 </span>            : 
<span class="lineNum">    2692 </span>            :       _CharT*
<span class="lineNum">    2693 </span>            :       _M_data(_CharT* __p) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2694 </span>            :       { return (_M_dataplus._M_p = __p); }
<span class="lineNum">    2695 </span>            : 
<span class="lineNum">    2696 </span>            :       _Rep*
<span class="lineNum">    2697 </span>            :       _M_rep() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2698 </span>            :       { return &amp;((reinterpret_cast&lt;_Rep*&gt; (_M_data()))[-1]); }
<span class="lineNum">    2699 </span>            : 
<span class="lineNum">    2700 </span>            :       // For the internal use we have functions similar to `begin'/`end'
<span class="lineNum">    2701 </span>            :       // but they do not call _M_leak.
<span class="lineNum">    2702 </span>            :       iterator
<span class="lineNum">    2703 </span>            :       _M_ibegin() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2704 </span>            :       { return iterator(_M_data()); }
<span class="lineNum">    2705 </span>            : 
<span class="lineNum">    2706 </span>            :       iterator
<span class="lineNum">    2707 </span>            :       _M_iend() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2708 </span>            :       { return iterator(_M_data() + this-&gt;size()); }
<span class="lineNum">    2709 </span>            : 
<span class="lineNum">    2710 </span>            :       void
<span class="lineNum">    2711 </span>            :       _M_leak()    // for use in begin() &amp; non-const op[]
<span class="lineNum">    2712 </span>            :       {
<span class="lineNum">    2713 </span>            :         if (!_M_rep()-&gt;_M_is_leaked())
<span class="lineNum">    2714 </span>            :           _M_leak_hard();
<span class="lineNum">    2715 </span>            :       }
<span class="lineNum">    2716 </span>            : 
<span class="lineNum">    2717 </span>            :       size_type
<span class="lineNum">    2718 </span>            :       _M_check(size_type __pos, const char* __s) const
<span class="lineNum">    2719 </span>            :       {
<span class="lineNum">    2720 </span>            :         if (__pos &gt; this-&gt;size())
<span class="lineNum">    2721 </span>            :           __throw_out_of_range_fmt(__N(&quot;%s: __pos (which is %zu) &gt; &quot;
<span class="lineNum">    2722 </span>            :                                        &quot;this-&gt;size() (which is %zu)&quot;),
<span class="lineNum">    2723 </span>            :                                    __s, __pos, this-&gt;size());
<span class="lineNum">    2724 </span>            :         return __pos;
<span class="lineNum">    2725 </span>            :       }
<span class="lineNum">    2726 </span>            : 
<span class="lineNum">    2727 </span>            :       void
<span class="lineNum">    2728 </span>            :       _M_check_length(size_type __n1, size_type __n2, const char* __s) const
<span class="lineNum">    2729 </span>            :       {
<span class="lineNum">    2730 </span>            :         if (this-&gt;max_size() - (this-&gt;size() - __n1) &lt; __n2)
<span class="lineNum">    2731 </span>            :           __throw_length_error(__N(__s));
<span class="lineNum">    2732 </span>            :       }
<span class="lineNum">    2733 </span>            : 
<span class="lineNum">    2734 </span>            :       // NB: _M_limit doesn't check for a bad __pos value.
<span class="lineNum">    2735 </span>            :       size_type
<span class="lineNum">    2736 </span>            :       _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2737 </span>            :       {
<span class="lineNum">    2738 </span>            :         const bool __testoff =  __off &lt; this-&gt;size() - __pos;
<span class="lineNum">    2739 </span>            :         return __testoff ? __off : this-&gt;size() - __pos;
<span class="lineNum">    2740 </span>            :       }
<span class="lineNum">    2741 </span>            : 
<span class="lineNum">    2742 </span>            :       // True if _Rep and source do not overlap.
<span class="lineNum">    2743 </span>            :       bool
<span class="lineNum">    2744 </span>            :       _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    2745 </span>            :       {
<span class="lineNum">    2746 </span>            :         return (less&lt;const _CharT*&gt;()(__s, _M_data())
<span class="lineNum">    2747 </span>            :                 || less&lt;const _CharT*&gt;()(_M_data() + this-&gt;size(), __s));
<span class="lineNum">    2748 </span>            :       }
<span class="lineNum">    2749 </span>            : 
<span class="lineNum">    2750 </span>            :       // When __n = 1 way faster than the general multichar
<span class="lineNum">    2751 </span>            :       // traits_type::copy/move/assign.
<span class="lineNum">    2752 </span>            :       static void
<span class="lineNum">    2753 </span>            :       _M_copy(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2754 </span>            :       {
<span class="lineNum">    2755 </span>            :         if (__n == 1)
<span class="lineNum">    2756 </span>            :           traits_type::assign(*__d, *__s);
<span class="lineNum">    2757 </span>            :         else
<span class="lineNum">    2758 </span>            :           traits_type::copy(__d, __s, __n);
<span class="lineNum">    2759 </span>            :       }
<span class="lineNum">    2760 </span>            : 
<span class="lineNum">    2761 </span>            :       static void
<span class="lineNum">    2762 </span>            :       _M_move(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2763 </span>            :       {
<span class="lineNum">    2764 </span>            :         if (__n == 1)
<span class="lineNum">    2765 </span>            :           traits_type::assign(*__d, *__s);
<span class="lineNum">    2766 </span>            :         else
<span class="lineNum">    2767 </span>            :           traits_type::move(__d, __s, __n);       
<span class="lineNum">    2768 </span>            :       }
<span class="lineNum">    2769 </span>            : 
<span class="lineNum">    2770 </span>            :       static void
<span class="lineNum">    2771 </span>            :       _M_assign(_CharT* __d, size_type __n, _CharT __c) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2772 </span>            :       {
<span class="lineNum">    2773 </span>            :         if (__n == 1)
<span class="lineNum">    2774 </span>            :           traits_type::assign(*__d, __c);
<span class="lineNum">    2775 </span>            :         else
<span class="lineNum">    2776 </span>            :           traits_type::assign(__d, __n, __c);     
<span class="lineNum">    2777 </span>            :       }
<span class="lineNum">    2778 </span>            : 
<span class="lineNum">    2779 </span>            :       // _S_copy_chars is a separate template to permit specialization
<span class="lineNum">    2780 </span>            :       // to optimize for the common case of pointers as iterators.
<span class="lineNum">    2781 </span>            :       template&lt;class _Iterator&gt;
<span class="lineNum">    2782 </span>            :         static void
<span class="lineNum">    2783 </span>            :         _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
<span class="lineNum">    2784 </span>            :         {
<span class="lineNum">    2785 </span>            :           for (; __k1 != __k2; ++__k1, ++__p)
<span class="lineNum">    2786 </span>            :             traits_type::assign(*__p, *__k1); // These types are off.
<span class="lineNum">    2787 </span>            :         }
<span class="lineNum">    2788 </span>            : 
<span class="lineNum">    2789 </span>            :       static void
<span class="lineNum">    2790 </span>            :       _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2791 </span>            :       { _S_copy_chars(__p, __k1.base(), __k2.base()); }
<span class="lineNum">    2792 </span>            : 
<span class="lineNum">    2793 </span>            :       static void
<span class="lineNum">    2794 </span>            :       _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
<span class="lineNum">    2795 </span>            :       _GLIBCXX_NOEXCEPT
<span class="lineNum">    2796 </span>            :       { _S_copy_chars(__p, __k1.base(), __k2.base()); }
<span class="lineNum">    2797 </span>            : 
<span class="lineNum">    2798 </span>            :       static void
<span class="lineNum">    2799 </span>            :       _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2800 </span>            :       { _M_copy(__p, __k1, __k2 - __k1); }
<span class="lineNum">    2801 </span>            : 
<span class="lineNum">    2802 </span>            :       static void
<span class="lineNum">    2803 </span>            :       _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
<span class="lineNum">    2804 </span>            :       _GLIBCXX_NOEXCEPT
<span class="lineNum">    2805 </span>            :       { _M_copy(__p, __k1, __k2 - __k1); }
<span class="lineNum">    2806 </span>            : 
<span class="lineNum">    2807 </span>            :       static int
<span class="lineNum">    2808 </span>            :       _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
<span class="lineNum">    2809 </span>            :       {
<span class="lineNum">    2810 </span>            :         const difference_type __d = difference_type(__n1 - __n2);
<span class="lineNum">    2811 </span>            : 
<span class="lineNum">    2812 </span>            :         if (__d &gt; __gnu_cxx::__numeric_traits&lt;int&gt;::__max)
<span class="lineNum">    2813 </span>            :           return __gnu_cxx::__numeric_traits&lt;int&gt;::__max;
<span class="lineNum">    2814 </span>            :         else if (__d &lt; __gnu_cxx::__numeric_traits&lt;int&gt;::__min)
<span class="lineNum">    2815 </span>            :           return __gnu_cxx::__numeric_traits&lt;int&gt;::__min;
<span class="lineNum">    2816 </span>            :         else
<span class="lineNum">    2817 </span>            :           return int(__d);
<span class="lineNum">    2818 </span>            :       }
<span class="lineNum">    2819 </span>            : 
<span class="lineNum">    2820 </span>            :       void
<span class="lineNum">    2821 </span>            :       _M_mutate(size_type __pos, size_type __len1, size_type __len2);
<span class="lineNum">    2822 </span>            : 
<span class="lineNum">    2823 </span>            :       void
<span class="lineNum">    2824 </span>            :       _M_leak_hard();
<span class="lineNum">    2825 </span>            : 
<span class="lineNum">    2826 </span>            :       static _Rep&amp;
<span class="lineNum">    2827 </span>            :       _S_empty_rep() _GLIBCXX_NOEXCEPT
<span class="lineNum">    2828 </span>            :       { return _Rep::_S_empty_rep(); }
<span class="lineNum">    2829 </span>            : 
<span class="lineNum">    2830 </span>            :     public:
<span class="lineNum">    2831 </span>            :       // Construct/copy/destroy:
<span class="lineNum">    2832 </span>            :       // NB: We overload ctors in some cases instead of using default
<span class="lineNum">    2833 </span>            :       // arguments, per 17.4.4.4 para. 2 item 2.
<span class="lineNum">    2834 </span>            : 
<span class="lineNum">    2835 </span>            :       /**
<span class="lineNum">    2836 </span>            :        *  @brief  Default constructor creates an empty string.
<span class="lineNum">    2837 </span>            :        */
<span class="lineNum">    2838 </span>            :       basic_string()
<span class="lineNum">    2839 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2840 </span>            :       : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
<span class="lineNum">    2841 </span>            : #else
<span class="lineNum">    2842 </span>            :       : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()){ }
<span class="lineNum">    2843 </span>            : #endif
<span class="lineNum">    2844 </span>            : 
<span class="lineNum">    2845 </span>            :       /**
<span class="lineNum">    2846 </span>            :        *  @brief  Construct an empty string using allocator @a a.
<span class="lineNum">    2847 </span>            :        */
<span class="lineNum">    2848 </span>            :       explicit
<span class="lineNum">    2849 </span>            :       basic_string(const _Alloc&amp; __a);
<span class="lineNum">    2850 </span>            : 
<span class="lineNum">    2851 </span>            :       // NB: per LWG issue 42, semantics different from IS:
<span class="lineNum">    2852 </span>            :       /**
<span class="lineNum">    2853 </span>            :        *  @brief  Construct string with copy of value of @a str.
<span class="lineNum">    2854 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2855 </span>            :        */
<span class="lineNum">    2856 </span>            :       basic_string(const basic_string&amp; __str);
<span class="lineNum">    2857 </span>            :       /**
<span class="lineNum">    2858 </span>            :        *  @brief  Construct string as copy of a substring.
<span class="lineNum">    2859 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2860 </span>            :        *  @param  __pos  Index of first character to copy from.
<span class="lineNum">    2861 </span>            :        *  @param  __n  Number of characters to copy (default remainder).
<span class="lineNum">    2862 </span>            :        */
<span class="lineNum">    2863 </span>            :       basic_string(const basic_string&amp; __str, size_type __pos,
<span class="lineNum">    2864 </span>            :                    size_type __n = npos);
<span class="lineNum">    2865 </span>            :       /**
<span class="lineNum">    2866 </span>            :        *  @brief  Construct string as copy of a substring.
<span class="lineNum">    2867 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2868 </span>            :        *  @param  __pos  Index of first character to copy from.
<span class="lineNum">    2869 </span>            :        *  @param  __n  Number of characters to copy.
<span class="lineNum">    2870 </span>            :        *  @param  __a  Allocator to use.
<span class="lineNum">    2871 </span>            :        */
<span class="lineNum">    2872 </span>            :       basic_string(const basic_string&amp; __str, size_type __pos,
<span class="lineNum">    2873 </span>            :                    size_type __n, const _Alloc&amp; __a);
<span class="lineNum">    2874 </span>            : 
<span class="lineNum">    2875 </span>            :       /**
<span class="lineNum">    2876 </span>            :        *  @brief  Construct string initialized by a character %array.
<span class="lineNum">    2877 </span>            :        *  @param  __s  Source character %array.
<span class="lineNum">    2878 </span>            :        *  @param  __n  Number of characters to copy.
<span class="lineNum">    2879 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">    2880 </span>            :        *
<span class="lineNum">    2881 </span>            :        *  NB: @a __s must have at least @a __n characters, &amp;apos;\\0&amp;apos;
<span class="lineNum">    2882 </span>            :        *  has no special meaning.
<span class="lineNum">    2883 </span>            :        */
<span class="lineNum">    2884 </span>            :       basic_string(const _CharT* __s, size_type __n,
<span class="lineNum">    2885 </span>            :                    const _Alloc&amp; __a = _Alloc());
<span class="lineNum">    2886 </span>            :       /**
<span class="lineNum">    2887 </span>            :        *  @brief  Construct string as copy of a C string.
<span class="lineNum">    2888 </span>            :        *  @param  __s  Source C string.
<span class="lineNum">    2889 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">    2890 </span>            :        */
<span class="lineNum">    2891 </span>            :       basic_string(const _CharT* __s, const _Alloc&amp; __a = _Alloc());
<span class="lineNum">    2892 </span>            :       /**
<span class="lineNum">    2893 </span>            :        *  @brief  Construct string as multiple characters.
<span class="lineNum">    2894 </span>            :        *  @param  __n  Number of characters.
<span class="lineNum">    2895 </span>            :        *  @param  __c  Character to use.
<span class="lineNum">    2896 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">    2897 </span>            :        */
<span class="lineNum">    2898 </span>            :       basic_string(size_type __n, _CharT __c, const _Alloc&amp; __a = _Alloc());
<span class="lineNum">    2899 </span>            : 
<span class="lineNum">    2900 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    2901 </span>            :       /**
<span class="lineNum">    2902 </span>            :        *  @brief  Move construct string.
<span class="lineNum">    2903 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2904 </span>            :        *
<span class="lineNum">    2905 </span>            :        *  The newly-created string contains the exact contents of @a __str.
<span class="lineNum">    2906 </span>            :        *  @a __str is a valid, but unspecified string.
<span class="lineNum">    2907 </span>            :        **/
<span class="lineNum">    2908 </span>            :       basic_string(basic_string&amp;&amp; __str)
<span class="lineNum">    2909 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2910 </span>            :       noexcept // FIXME C++11: should always be noexcept.
<span class="lineNum">    2911 </span>            : #endif
<span class="lineNum">    2912 </span>            :       : _M_dataplus(__str._M_dataplus)
<span class="lineNum">    2913 </span>            :       {
<span class="lineNum">    2914 </span>            : #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
<span class="lineNum">    2915 </span>            :         __str._M_data(_S_empty_rep()._M_refdata());
<span class="lineNum">    2916 </span>            : #else
<span class="lineNum">    2917 </span>            :         __str._M_data(_S_construct(size_type(), _CharT(), get_allocator()));
<span class="lineNum">    2918 </span>            : #endif
<span class="lineNum">    2919 </span>            :       }
<span class="lineNum">    2920 </span>            : 
<span class="lineNum">    2921 </span>            :       /**
<span class="lineNum">    2922 </span>            :        *  @brief  Construct string from an initializer %list.
<span class="lineNum">    2923 </span>            :        *  @param  __l  std::initializer_list of characters.
<span class="lineNum">    2924 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">    2925 </span>            :        */
<span class="lineNum">    2926 </span>            :       basic_string(initializer_list&lt;_CharT&gt; __l, const _Alloc&amp; __a = _Alloc());
<span class="lineNum">    2927 </span>            : #endif // C++11
<span class="lineNum">    2928 </span>            : 
<span class="lineNum">    2929 </span>            :       /**
<span class="lineNum">    2930 </span>            :        *  @brief  Construct string as copy of a range.
<span class="lineNum">    2931 </span>            :        *  @param  __beg  Start of range.
<span class="lineNum">    2932 </span>            :        *  @param  __end  End of range.
<span class="lineNum">    2933 </span>            :        *  @param  __a  Allocator to use (default is default allocator).
<span class="lineNum">    2934 </span>            :        */
<span class="lineNum">    2935 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    2936 </span>            :         basic_string(_InputIterator __beg, _InputIterator __end,
<span class="lineNum">    2937 </span>            :                      const _Alloc&amp; __a = _Alloc());
<span class="lineNum">    2938 </span>            : 
<span class="lineNum">    2939 </span>            :       /**
<span class="lineNum">    2940 </span>            :        *  @brief  Destroy the string instance.
<span class="lineNum">    2941 </span>            :        */
<span class="lineNum">    2942 </span>            :       ~basic_string() _GLIBCXX_NOEXCEPT
<span class="lineNum">    2943 </span>            :       { _M_rep()-&gt;_M_dispose(this-&gt;get_allocator()); }
<span class="lineNum">    2944 </span>            : 
<span class="lineNum">    2945 </span>            :       /**
<span class="lineNum">    2946 </span>            :        *  @brief  Assign the value of @a str to this string.
<span class="lineNum">    2947 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2948 </span>            :        */
<span class="lineNum">    2949 </span>            :       basic_string&amp;
<span class="lineNum">    2950 </span>            :       operator=(const basic_string&amp; __str) 
<span class="lineNum">    2951 </span>            :       { return this-&gt;assign(__str); }
<span class="lineNum">    2952 </span>            : 
<span class="lineNum">    2953 </span>            :       /**
<span class="lineNum">    2954 </span>            :        *  @brief  Copy contents of @a s into this string.
<span class="lineNum">    2955 </span>            :        *  @param  __s  Source null-terminated string.
<span class="lineNum">    2956 </span>            :        */
<span class="lineNum">    2957 </span>            :       basic_string&amp;
<span class="lineNum">    2958 </span>            :       operator=(const _CharT* __s) 
<span class="lineNum">    2959 </span>            :       { return this-&gt;assign(__s); }
<span class="lineNum">    2960 </span>            : 
<span class="lineNum">    2961 </span>            :       /**
<span class="lineNum">    2962 </span>            :        *  @brief  Set value to string of length 1.
<span class="lineNum">    2963 </span>            :        *  @param  __c  Source character.
<span class="lineNum">    2964 </span>            :        *
<span class="lineNum">    2965 </span>            :        *  Assigning to a character makes this string length 1 and
<span class="lineNum">    2966 </span>            :        *  (*this)[0] == @a c.
<span class="lineNum">    2967 </span>            :        */
<span class="lineNum">    2968 </span>            :       basic_string&amp;
<span class="lineNum">    2969 </span>            :       operator=(_CharT __c) 
<span class="lineNum">    2970 </span>            :       { 
<span class="lineNum">    2971 </span>            :         this-&gt;assign(1, __c); 
<span class="lineNum">    2972 </span>            :         return *this;
<span class="lineNum">    2973 </span>            :       }
<span class="lineNum">    2974 </span>            : 
<span class="lineNum">    2975 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    2976 </span>            :       /**
<span class="lineNum">    2977 </span>            :        *  @brief  Move assign the value of @a str to this string.
<span class="lineNum">    2978 </span>            :        *  @param  __str  Source string.
<span class="lineNum">    2979 </span>            :        *
<span class="lineNum">    2980 </span>            :        *  The contents of @a str are moved into this string (without copying).
<span class="lineNum">    2981 </span>            :        *  @a str is a valid, but unspecified string.
<span class="lineNum">    2982 </span>            :        **/
<span class="lineNum">    2983 </span>            :       // PR 58265, this should be noexcept.
<span class="lineNum">    2984 </span>            :       basic_string&amp;
<span class="lineNum">    2985 </span>            :       operator=(basic_string&amp;&amp; __str)
<span class="lineNum">    2986 </span>            :       {
<span class="lineNum">    2987 </span>            :         // NB: DR 1204.
<span class="lineNum">    2988 </span>            :         this-&gt;swap(__str);
<span class="lineNum">    2989 </span>            :         return *this;
<span class="lineNum">    2990 </span>            :       }
<span class="lineNum">    2991 </span>            : 
<span class="lineNum">    2992 </span>            :       /**
<span class="lineNum">    2993 </span>            :        *  @brief  Set value to string constructed from initializer %list.
<span class="lineNum">    2994 </span>            :        *  @param  __l  std::initializer_list.
<span class="lineNum">    2995 </span>            :        */
<span class="lineNum">    2996 </span>            :       basic_string&amp;
<span class="lineNum">    2997 </span>            :       operator=(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    2998 </span>            :       {
<span class="lineNum">    2999 </span>            :         this-&gt;assign(__l.begin(), __l.size());
<span class="lineNum">    3000 </span>            :         return *this;
<span class="lineNum">    3001 </span>            :       }
<span class="lineNum">    3002 </span>            : #endif // C++11
<span class="lineNum">    3003 </span>            : 
<span class="lineNum">    3004 </span>            :       // Iterators:
<span class="lineNum">    3005 </span>            :       /**
<span class="lineNum">    3006 </span>            :        *  Returns a read/write iterator that points to the first character in
<span class="lineNum">    3007 </span>            :        *  the %string.  Unshares the string.
<span class="lineNum">    3008 </span>            :        */
<span class="lineNum">    3009 </span>            :       iterator
<span class="lineNum">    3010 </span>            :       begin() // FIXME C++11: should be noexcept.
<span class="lineNum">    3011 </span>            :       {
<span class="lineNum">    3012 </span>            :         _M_leak();
<span class="lineNum">    3013 </span>            :         return iterator(_M_data());
<span class="lineNum">    3014 </span>            :       }
<span class="lineNum">    3015 </span>            : 
<span class="lineNum">    3016 </span>            :       /**
<span class="lineNum">    3017 </span>            :        *  Returns a read-only (constant) iterator that points to the first
<span class="lineNum">    3018 </span>            :        *  character in the %string.
<span class="lineNum">    3019 </span>            :        */
<span class="lineNum">    3020 </span>            :       const_iterator
<span class="lineNum">    3021 </span>            :       begin() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3022 </span>            :       { return const_iterator(_M_data()); }
<span class="lineNum">    3023 </span>            : 
<span class="lineNum">    3024 </span>            :       /**
<span class="lineNum">    3025 </span>            :        *  Returns a read/write iterator that points one past the last
<span class="lineNum">    3026 </span>            :        *  character in the %string.  Unshares the string.
<span class="lineNum">    3027 </span>            :        */
<span class="lineNum">    3028 </span>            :       iterator
<span class="lineNum">    3029 </span>            :       end() // FIXME C++11: should be noexcept.
<span class="lineNum">    3030 </span>            :       {
<span class="lineNum">    3031 </span>            :         _M_leak();
<span class="lineNum">    3032 </span>            :         return iterator(_M_data() + this-&gt;size());
<span class="lineNum">    3033 </span>            :       }
<span class="lineNum">    3034 </span>            : 
<span class="lineNum">    3035 </span>            :       /**
<span class="lineNum">    3036 </span>            :        *  Returns a read-only (constant) iterator that points one past the
<span class="lineNum">    3037 </span>            :        *  last character in the %string.
<span class="lineNum">    3038 </span>            :        */
<span class="lineNum">    3039 </span>            :       const_iterator
<span class="lineNum">    3040 </span>            :       end() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3041 </span>            :       { return const_iterator(_M_data() + this-&gt;size()); }
<span class="lineNum">    3042 </span>            : 
<span class="lineNum">    3043 </span>            :       /**
<span class="lineNum">    3044 </span>            :        *  Returns a read/write reverse iterator that points to the last
<span class="lineNum">    3045 </span>            :        *  character in the %string.  Iteration is done in reverse element
<span class="lineNum">    3046 </span>            :        *  order.  Unshares the string.
<span class="lineNum">    3047 </span>            :        */
<span class="lineNum">    3048 </span>            :       reverse_iterator
<span class="lineNum">    3049 </span>            :       rbegin() // FIXME C++11: should be noexcept.
<span class="lineNum">    3050 </span>            :       { return reverse_iterator(this-&gt;end()); }
<span class="lineNum">    3051 </span>            : 
<span class="lineNum">    3052 </span>            :       /**
<span class="lineNum">    3053 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">    3054 </span>            :        *  to the last character in the %string.  Iteration is done in
<span class="lineNum">    3055 </span>            :        *  reverse element order.
<span class="lineNum">    3056 </span>            :        */
<span class="lineNum">    3057 </span>            :       const_reverse_iterator
<span class="lineNum">    3058 </span>            :       rbegin() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3059 </span>            :       { return const_reverse_iterator(this-&gt;end()); }
<span class="lineNum">    3060 </span>            : 
<span class="lineNum">    3061 </span>            :       /**
<span class="lineNum">    3062 </span>            :        *  Returns a read/write reverse iterator that points to one before the
<span class="lineNum">    3063 </span>            :        *  first character in the %string.  Iteration is done in reverse
<span class="lineNum">    3064 </span>            :        *  element order.  Unshares the string.
<span class="lineNum">    3065 </span>            :        */
<span class="lineNum">    3066 </span>            :       reverse_iterator
<span class="lineNum">    3067 </span>            :       rend() // FIXME C++11: should be noexcept.
<span class="lineNum">    3068 </span>            :       { return reverse_iterator(this-&gt;begin()); }
<span class="lineNum">    3069 </span>            : 
<span class="lineNum">    3070 </span>            :       /**
<span class="lineNum">    3071 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">    3072 </span>            :        *  to one before the first character in the %string.  Iteration
<span class="lineNum">    3073 </span>            :        *  is done in reverse element order.
<span class="lineNum">    3074 </span>            :        */
<span class="lineNum">    3075 </span>            :       const_reverse_iterator
<span class="lineNum">    3076 </span>            :       rend() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3077 </span>            :       { return const_reverse_iterator(this-&gt;begin()); }
<span class="lineNum">    3078 </span>            : 
<span class="lineNum">    3079 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3080 </span>            :       /**
<span class="lineNum">    3081 </span>            :        *  Returns a read-only (constant) iterator that points to the first
<span class="lineNum">    3082 </span>            :        *  character in the %string.
<span class="lineNum">    3083 </span>            :        */
<span class="lineNum">    3084 </span>            :       const_iterator
<span class="lineNum">    3085 </span>            :       cbegin() const noexcept
<span class="lineNum">    3086 </span>            :       { return const_iterator(this-&gt;_M_data()); }
<span class="lineNum">    3087 </span>            : 
<span class="lineNum">    3088 </span>            :       /**
<span class="lineNum">    3089 </span>            :        *  Returns a read-only (constant) iterator that points one past the
<span class="lineNum">    3090 </span>            :        *  last character in the %string.
<span class="lineNum">    3091 </span>            :        */
<span class="lineNum">    3092 </span>            :       const_iterator
<span class="lineNum">    3093 </span>            :       cend() const noexcept
<span class="lineNum">    3094 </span>            :       { return const_iterator(this-&gt;_M_data() + this-&gt;size()); }
<span class="lineNum">    3095 </span>            : 
<span class="lineNum">    3096 </span>            :       /**
<span class="lineNum">    3097 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">    3098 </span>            :        *  to the last character in the %string.  Iteration is done in
<span class="lineNum">    3099 </span>            :        *  reverse element order.
<span class="lineNum">    3100 </span>            :        */
<span class="lineNum">    3101 </span>            :       const_reverse_iterator
<span class="lineNum">    3102 </span>            :       crbegin() const noexcept
<span class="lineNum">    3103 </span>            :       { return const_reverse_iterator(this-&gt;end()); }
<span class="lineNum">    3104 </span>            : 
<span class="lineNum">    3105 </span>            :       /**
<span class="lineNum">    3106 </span>            :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">    3107 </span>            :        *  to one before the first character in the %string.  Iteration
<span class="lineNum">    3108 </span>            :        *  is done in reverse element order.
<span class="lineNum">    3109 </span>            :        */
<span class="lineNum">    3110 </span>            :       const_reverse_iterator
<span class="lineNum">    3111 </span>            :       crend() const noexcept
<span class="lineNum">    3112 </span>            :       { return const_reverse_iterator(this-&gt;begin()); }
<span class="lineNum">    3113 </span>            : #endif
<span class="lineNum">    3114 </span>            : 
<span class="lineNum">    3115 </span>            :     public:
<span class="lineNum">    3116 </span>            :       // Capacity:
<span class="lineNum">    3117 </span>            :       ///  Returns the number of characters in the string, not including any
<span class="lineNum">    3118 </span>            :       ///  null-termination.
<span class="lineNum">    3119 </span>            :       size_type
<span class="lineNum">    3120 </span>            :       size() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3121 </span>            :       { return _M_rep()-&gt;_M_length; }
<span class="lineNum">    3122 </span>            : 
<span class="lineNum">    3123 </span>            :       ///  Returns the number of characters in the string, not including any
<span class="lineNum">    3124 </span>            :       ///  null-termination.
<span class="lineNum">    3125 </span>            :       size_type
<span class="lineNum">    3126 </span>            :       length() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3127 </span>            :       { return _M_rep()-&gt;_M_length; }
<span class="lineNum">    3128 </span>            : 
<span class="lineNum">    3129 </span>            :       ///  Returns the size() of the largest possible %string.
<span class="lineNum">    3130 </span>            :       size_type
<span class="lineNum">    3131 </span>            :       max_size() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3132 </span>            :       { return _Rep::_S_max_size; }
<span class="lineNum">    3133 </span>            : 
<span class="lineNum">    3134 </span>            :       /**
<span class="lineNum">    3135 </span>            :        *  @brief  Resizes the %string to the specified number of characters.
<span class="lineNum">    3136 </span>            :        *  @param  __n  Number of characters the %string should contain.
<span class="lineNum">    3137 </span>            :        *  @param  __c  Character to fill any new elements.
<span class="lineNum">    3138 </span>            :        *
<span class="lineNum">    3139 </span>            :        *  This function will %resize the %string to the specified
<span class="lineNum">    3140 </span>            :        *  number of characters.  If the number is smaller than the
<span class="lineNum">    3141 </span>            :        *  %string's current size the %string is truncated, otherwise
<span class="lineNum">    3142 </span>            :        *  the %string is extended and new elements are %set to @a __c.
<span class="lineNum">    3143 </span>            :        */
<span class="lineNum">    3144 </span>            :       void
<span class="lineNum">    3145 </span>            :       resize(size_type __n, _CharT __c);
<span class="lineNum">    3146 </span>            : 
<span class="lineNum">    3147 </span>            :       /**
<span class="lineNum">    3148 </span>            :        *  @brief  Resizes the %string to the specified number of characters.
<span class="lineNum">    3149 </span>            :        *  @param  __n  Number of characters the %string should contain.
<span class="lineNum">    3150 </span>            :        *
<span class="lineNum">    3151 </span>            :        *  This function will resize the %string to the specified length.  If
<span class="lineNum">    3152 </span>            :        *  the new size is smaller than the %string's current size the %string
<span class="lineNum">    3153 </span>            :        *  is truncated, otherwise the %string is extended and new characters
<span class="lineNum">    3154 </span>            :        *  are default-constructed.  For basic types such as char, this means
<span class="lineNum">    3155 </span>            :        *  setting them to 0.
<span class="lineNum">    3156 </span>            :        */
<span class="lineNum">    3157 </span>            :       void
<span class="lineNum">    3158 </span>            :       resize(size_type __n)
<span class="lineNum">    3159 </span>            :       { this-&gt;resize(__n, _CharT()); }
<span class="lineNum">    3160 </span>            : 
<span class="lineNum">    3161 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3162 </span>            :       ///  A non-binding request to reduce capacity() to size().
<span class="lineNum">    3163 </span>            :       void
<span class="lineNum">    3164 </span>            :       shrink_to_fit() _GLIBCXX_NOEXCEPT
<span class="lineNum">    3165 </span>            :       {
<span class="lineNum">    3166 </span>            : #if __cpp_exceptions
<span class="lineNum">    3167 </span>            :         if (capacity() &gt; size())
<span class="lineNum">    3168 </span>            :           {
<span class="lineNum">    3169 </span>            :             try
<span class="lineNum">    3170 </span>            :               { reserve(0); }
<span class="lineNum">    3171 </span>            :             catch(...)
<span class="lineNum">    3172 </span>            :               { }
<span class="lineNum">    3173 </span>            :           }
<span class="lineNum">    3174 </span>            : #endif
<span class="lineNum">    3175 </span>            :       }
<span class="lineNum">    3176 </span>            : #endif
<span class="lineNum">    3177 </span>            : 
<span class="lineNum">    3178 </span>            :       /**
<span class="lineNum">    3179 </span>            :        *  Returns the total number of characters that the %string can hold
<span class="lineNum">    3180 </span>            :        *  before needing to allocate more memory.
<span class="lineNum">    3181 </span>            :        */
<span class="lineNum">    3182 </span>            :       size_type
<span class="lineNum">    3183 </span>            :       capacity() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3184 </span>            :       { return _M_rep()-&gt;_M_capacity; }
<span class="lineNum">    3185 </span>            : 
<span class="lineNum">    3186 </span>            :       /**
<span class="lineNum">    3187 </span>            :        *  @brief  Attempt to preallocate enough memory for specified number of
<span class="lineNum">    3188 </span>            :        *          characters.
<span class="lineNum">    3189 </span>            :        *  @param  __res_arg  Number of characters required.
<span class="lineNum">    3190 </span>            :        *  @throw  std::length_error  If @a __res_arg exceeds @c max_size().
<span class="lineNum">    3191 </span>            :        *
<span class="lineNum">    3192 </span>            :        *  This function attempts to reserve enough memory for the
<span class="lineNum">    3193 </span>            :        *  %string to hold the specified number of characters.  If the
<span class="lineNum">    3194 </span>            :        *  number requested is more than max_size(), length_error is
<span class="lineNum">    3195 </span>            :        *  thrown.
<span class="lineNum">    3196 </span>            :        *
<span class="lineNum">    3197 </span>            :        *  The advantage of this function is that if optimal code is a
<span class="lineNum">    3198 </span>            :        *  necessity and the user can determine the string length that will be
<span class="lineNum">    3199 </span>            :        *  required, the user can reserve the memory in %advance, and thus
<span class="lineNum">    3200 </span>            :        *  prevent a possible reallocation of memory and copying of %string
<span class="lineNum">    3201 </span>            :        *  data.
<span class="lineNum">    3202 </span>            :        */
<span class="lineNum">    3203 </span>            :       void
<span class="lineNum">    3204 </span>            :       reserve(size_type __res_arg = 0);
<span class="lineNum">    3205 </span>            : 
<span class="lineNum">    3206 </span>            :       /**
<span class="lineNum">    3207 </span>            :        *  Erases the string, making it empty.
<span class="lineNum">    3208 </span>            :        */
<span class="lineNum">    3209 </span>            :       // PR 56166: this should not throw.
<span class="lineNum">    3210 </span>            :       void
<span class="lineNum">    3211 </span>            :       clear()
<span class="lineNum">    3212 </span>            :       { _M_mutate(0, this-&gt;size(), 0); }
<span class="lineNum">    3213 </span>            : 
<span class="lineNum">    3214 </span>            :       /**
<span class="lineNum">    3215 </span>            :        *  Returns true if the %string is empty.  Equivalent to 
<span class="lineNum">    3216 </span>            :        *  &lt;code&gt;*this == &quot;&quot;&lt;/code&gt;.
<span class="lineNum">    3217 </span>            :        */
<span class="lineNum">    3218 </span>            :       bool
<span class="lineNum">    3219 </span>            :       empty() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3220 </span>            :       { return this-&gt;size() == 0; }
<span class="lineNum">    3221 </span>            : 
<span class="lineNum">    3222 </span>            :       // Element access:
<span class="lineNum">    3223 </span>            :       /**
<span class="lineNum">    3224 </span>            :        *  @brief  Subscript access to the data contained in the %string.
<span class="lineNum">    3225 </span>            :        *  @param  __pos  The index of the character to access.
<span class="lineNum">    3226 </span>            :        *  @return  Read-only (constant) reference to the character.
<span class="lineNum">    3227 </span>            :        *
<span class="lineNum">    3228 </span>            :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">    3229 </span>            :        *  Note that data access with this operator is unchecked and
<span class="lineNum">    3230 </span>            :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">    3231 </span>            :        *  see at().)
<span class="lineNum">    3232 </span>            :        */
<span class="lineNum">    3233 </span>            :       const_reference
<span class="lineNum">    3234 </span>            :       operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3235 </span>            :       {
<span class="lineNum">    3236 </span>            :         _GLIBCXX_DEBUG_ASSERT(__pos &lt;= size());
<span class="lineNum">    3237 </span>            :         return _M_data()[__pos];
<span class="lineNum">    3238 </span>            :       }
<span class="lineNum">    3239 </span>            : 
<span class="lineNum">    3240 </span>            :       /**
<span class="lineNum">    3241 </span>            :        *  @brief  Subscript access to the data contained in the %string.
<span class="lineNum">    3242 </span>            :        *  @param  __pos  The index of the character to access.
<span class="lineNum">    3243 </span>            :        *  @return  Read/write reference to the character.
<span class="lineNum">    3244 </span>            :        *
<span class="lineNum">    3245 </span>            :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">    3246 </span>            :        *  Note that data access with this operator is unchecked and
<span class="lineNum">    3247 </span>            :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">    3248 </span>            :        *  see at().)  Unshares the string.
<span class="lineNum">    3249 </span>            :        */
<span class="lineNum">    3250 </span>            :       reference
<span class="lineNum">    3251 </span>            :       operator[](size_type __pos)
<span class="lineNum">    3252 </span>            :       {
<span class="lineNum">    3253 </span>            :         // Allow pos == size() both in C++98 mode, as v3 extension,
<span class="lineNum">    3254 </span>            :         // and in C++11 mode.
<span class="lineNum">    3255 </span>            :         _GLIBCXX_DEBUG_ASSERT(__pos &lt;= size());
<span class="lineNum">    3256 </span>            :         // In pedantic mode be strict in C++98 mode.
<span class="lineNum">    3257 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__cplusplus &gt;= 201103L || __pos &lt; size());
<span class="lineNum">    3258 </span>            :         _M_leak();
<span class="lineNum">    3259 </span>            :         return _M_data()[__pos];
<span class="lineNum">    3260 </span>            :       }
<span class="lineNum">    3261 </span>            : 
<span class="lineNum">    3262 </span>            :       /**
<span class="lineNum">    3263 </span>            :        *  @brief  Provides access to the data contained in the %string.
<span class="lineNum">    3264 </span>            :        *  @param __n The index of the character to access.
<span class="lineNum">    3265 </span>            :        *  @return  Read-only (const) reference to the character.
<span class="lineNum">    3266 </span>            :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">    3267 </span>            :        *
<span class="lineNum">    3268 </span>            :        *  This function provides for safer data access.  The parameter is
<span class="lineNum">    3269 </span>            :        *  first checked that it is in the range of the string.  The function
<span class="lineNum">    3270 </span>            :        *  throws out_of_range if the check fails.
<span class="lineNum">    3271 </span>            :        */
<span class="lineNum">    3272 </span>            :       const_reference
<span class="lineNum">    3273 </span>            :       at(size_type __n) const
<span class="lineNum">    3274 </span>            :       {
<span class="lineNum">    3275 </span>            :         if (__n &gt;= this-&gt;size())
<span class="lineNum">    3276 </span>            :           __throw_out_of_range_fmt(__N(&quot;basic_string::at: __n &quot;
<span class="lineNum">    3277 </span>            :                                        &quot;(which is %zu) &gt;= this-&gt;size() &quot;
<span class="lineNum">    3278 </span>            :                                        &quot;(which is %zu)&quot;),
<span class="lineNum">    3279 </span>            :                                    __n, this-&gt;size());
<span class="lineNum">    3280 </span>            :         return _M_data()[__n];
<span class="lineNum">    3281 </span>            :       }
<span class="lineNum">    3282 </span>            : 
<span class="lineNum">    3283 </span>            :       /**
<span class="lineNum">    3284 </span>            :        *  @brief  Provides access to the data contained in the %string.
<span class="lineNum">    3285 </span>            :        *  @param __n The index of the character to access.
<span class="lineNum">    3286 </span>            :        *  @return  Read/write reference to the character.
<span class="lineNum">    3287 </span>            :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">    3288 </span>            :        *
<span class="lineNum">    3289 </span>            :        *  This function provides for safer data access.  The parameter is
<span class="lineNum">    3290 </span>            :        *  first checked that it is in the range of the string.  The function
<span class="lineNum">    3291 </span>            :        *  throws out_of_range if the check fails.  Success results in
<span class="lineNum">    3292 </span>            :        *  unsharing the string.
<span class="lineNum">    3293 </span>            :        */
<span class="lineNum">    3294 </span>            :       reference
<span class="lineNum">    3295 </span>            :       at(size_type __n)
<span class="lineNum">    3296 </span>            :       {
<span class="lineNum">    3297 </span>            :         if (__n &gt;= size())
<span class="lineNum">    3298 </span>            :           __throw_out_of_range_fmt(__N(&quot;basic_string::at: __n &quot;
<span class="lineNum">    3299 </span>            :                                        &quot;(which is %zu) &gt;= this-&gt;size() &quot;
<span class="lineNum">    3300 </span>            :                                        &quot;(which is %zu)&quot;),
<span class="lineNum">    3301 </span>            :                                    __n, this-&gt;size());
<span class="lineNum">    3302 </span>            :         _M_leak();
<span class="lineNum">    3303 </span>            :         return _M_data()[__n];
<span class="lineNum">    3304 </span>            :       }
<span class="lineNum">    3305 </span>            : 
<span class="lineNum">    3306 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3307 </span>            :       /**
<span class="lineNum">    3308 </span>            :        *  Returns a read/write reference to the data at the first
<span class="lineNum">    3309 </span>            :        *  element of the %string.
<span class="lineNum">    3310 </span>            :        */
<span class="lineNum">    3311 </span>            :       reference
<span class="lineNum">    3312 </span>            :       front()
<span class="lineNum">    3313 </span>            :       { return operator[](0); }
<span class="lineNum">    3314 </span>            : 
<span class="lineNum">    3315 </span>            :       /**
<span class="lineNum">    3316 </span>            :        *  Returns a read-only (constant) reference to the data at the first
<span class="lineNum">    3317 </span>            :        *  element of the %string.
<span class="lineNum">    3318 </span>            :        */
<span class="lineNum">    3319 </span>            :       const_reference
<span class="lineNum">    3320 </span>            :       front() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3321 </span>            :       { return operator[](0); }
<span class="lineNum">    3322 </span>            : 
<span class="lineNum">    3323 </span>            :       /**
<span class="lineNum">    3324 </span>            :        *  Returns a read/write reference to the data at the last
<span class="lineNum">    3325 </span>            :        *  element of the %string.
<span class="lineNum">    3326 </span>            :        */
<span class="lineNum">    3327 </span>            :       reference
<span class="lineNum">    3328 </span>            :       back()
<span class="lineNum">    3329 </span>            :       { return operator[](this-&gt;size() - 1); }
<span class="lineNum">    3330 </span>            : 
<span class="lineNum">    3331 </span>            :       /**
<span class="lineNum">    3332 </span>            :        *  Returns a read-only (constant) reference to the data at the
<span class="lineNum">    3333 </span>            :        *  last element of the %string.
<span class="lineNum">    3334 </span>            :        */
<span class="lineNum">    3335 </span>            :       const_reference
<span class="lineNum">    3336 </span>            :       back() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    3337 </span>            :       { return operator[](this-&gt;size() - 1); }
<span class="lineNum">    3338 </span>            : #endif
<span class="lineNum">    3339 </span>            : 
<span class="lineNum">    3340 </span>            :       // Modifiers:
<span class="lineNum">    3341 </span>            :       /**
<span class="lineNum">    3342 </span>            :        *  @brief  Append a string to this string.
<span class="lineNum">    3343 </span>            :        *  @param __str  The string to append.
<span class="lineNum">    3344 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3345 </span>            :        */
<span class="lineNum">    3346 </span>            :       basic_string&amp;
<span class="lineNum">    3347 </span>            :       operator+=(const basic_string&amp; __str)
<span class="lineNum">    3348 </span>            :       { return this-&gt;append(__str); }
<span class="lineNum">    3349 </span>            : 
<span class="lineNum">    3350 </span>            :       /**
<span class="lineNum">    3351 </span>            :        *  @brief  Append a C string.
<span class="lineNum">    3352 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">    3353 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3354 </span>            :        */
<span class="lineNum">    3355 </span>            :       basic_string&amp;
<span class="lineNum">    3356 </span>            :       operator+=(const _CharT* __s)
<span class="lineNum">    3357 </span>            :       { return this-&gt;append(__s); }
<span class="lineNum">    3358 </span>            : 
<span class="lineNum">    3359 </span>            :       /**
<span class="lineNum">    3360 </span>            :        *  @brief  Append a character.
<span class="lineNum">    3361 </span>            :        *  @param __c  The character to append.
<span class="lineNum">    3362 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3363 </span>            :        */
<span class="lineNum">    3364 </span>            :       basic_string&amp;
<span class="lineNum">    3365 </span>            :       operator+=(_CharT __c)
<span class="lineNum">    3366 </span>            :       { 
<span class="lineNum">    3367 </span>            :         this-&gt;push_back(__c);
<span class="lineNum">    3368 </span>            :         return *this;
<span class="lineNum">    3369 </span>            :       }
<span class="lineNum">    3370 </span>            : 
<span class="lineNum">    3371 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3372 </span>            :       /**
<span class="lineNum">    3373 </span>            :        *  @brief  Append an initializer_list of characters.
<span class="lineNum">    3374 </span>            :        *  @param __l  The initializer_list of characters to be appended.
<span class="lineNum">    3375 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3376 </span>            :        */
<span class="lineNum">    3377 </span>            :       basic_string&amp;
<span class="lineNum">    3378 </span>            :       operator+=(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    3379 </span>            :       { return this-&gt;append(__l.begin(), __l.size()); }
<span class="lineNum">    3380 </span>            : #endif // C++11
<span class="lineNum">    3381 </span>            : 
<span class="lineNum">    3382 </span>            :       /**
<span class="lineNum">    3383 </span>            :        *  @brief  Append a string to this string.
<span class="lineNum">    3384 </span>            :        *  @param __str  The string to append.
<span class="lineNum">    3385 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3386 </span>            :        */
<span class="lineNum">    3387 </span>            :       basic_string&amp;
<span class="lineNum">    3388 </span>            :       append(const basic_string&amp; __str);
<span class="lineNum">    3389 </span>            : 
<span class="lineNum">    3390 </span>            :       /**
<span class="lineNum">    3391 </span>            :        *  @brief  Append a substring.
<span class="lineNum">    3392 </span>            :        *  @param __str  The string to append.
<span class="lineNum">    3393 </span>            :        *  @param __pos  Index of the first character of str to append.
<span class="lineNum">    3394 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">    3395 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3396 </span>            :        *  @throw  std::out_of_range if @a __pos is not a valid index.
<span class="lineNum">    3397 </span>            :        *
<span class="lineNum">    3398 </span>            :        *  This function appends @a __n characters from @a __str
<span class="lineNum">    3399 </span>            :        *  starting at @a __pos to this string.  If @a __n is is larger
<span class="lineNum">    3400 </span>            :        *  than the number of available characters in @a __str, the
<span class="lineNum">    3401 </span>            :        *  remainder of @a __str is appended.
<span class="lineNum">    3402 </span>            :        */
<span class="lineNum">    3403 </span>            :       basic_string&amp;
<span class="lineNum">    3404 </span>            :       append(const basic_string&amp; __str, size_type __pos, size_type __n);
<span class="lineNum">    3405 </span>            : 
<span class="lineNum">    3406 </span>            :       /**
<span class="lineNum">    3407 </span>            :        *  @brief  Append a C substring.
<span class="lineNum">    3408 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">    3409 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">    3410 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3411 </span>            :        */
<span class="lineNum">    3412 </span>            :       basic_string&amp;
<span class="lineNum">    3413 </span>            :       append(const _CharT* __s, size_type __n);
<span class="lineNum">    3414 </span>            : 
<span class="lineNum">    3415 </span>            :       /**
<span class="lineNum">    3416 </span>            :        *  @brief  Append a C string.
<span class="lineNum">    3417 </span>            :        *  @param __s  The C string to append.
<span class="lineNum">    3418 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3419 </span>            :        */
<span class="lineNum">    3420 </span>            :       basic_string&amp;
<span class="lineNum">    3421 </span>            :       append(const _CharT* __s)
<span class="lineNum">    3422 </span>            :       {
<span class="lineNum">    3423 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    3424 </span>            :         return this-&gt;append(__s, traits_type::length(__s));
<span class="lineNum">    3425 </span>            :       }
<span class="lineNum">    3426 </span>            : 
<span class="lineNum">    3427 </span>            :       /**
<span class="lineNum">    3428 </span>            :        *  @brief  Append multiple characters.
<span class="lineNum">    3429 </span>            :        *  @param __n  The number of characters to append.
<span class="lineNum">    3430 </span>            :        *  @param __c  The character to use.
<span class="lineNum">    3431 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3432 </span>            :        *
<span class="lineNum">    3433 </span>            :        *  Appends __n copies of __c to this string.
<span class="lineNum">    3434 </span>            :        */
<span class="lineNum">    3435 </span>            :       basic_string&amp;
<span class="lineNum">    3436 </span>            :       append(size_type __n, _CharT __c);
<span class="lineNum">    3437 </span>            : 
<span class="lineNum">    3438 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3439 </span>            :       /**
<span class="lineNum">    3440 </span>            :        *  @brief  Append an initializer_list of characters.
<span class="lineNum">    3441 </span>            :        *  @param __l  The initializer_list of characters to append.
<span class="lineNum">    3442 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3443 </span>            :        */
<span class="lineNum">    3444 </span>            :       basic_string&amp;
<span class="lineNum">    3445 </span>            :       append(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    3446 </span>            :       { return this-&gt;append(__l.begin(), __l.size()); }
<span class="lineNum">    3447 </span>            : #endif // C++11
<span class="lineNum">    3448 </span>            : 
<span class="lineNum">    3449 </span>            :       /**
<span class="lineNum">    3450 </span>            :        *  @brief  Append a range of characters.
<span class="lineNum">    3451 </span>            :        *  @param __first  Iterator referencing the first character to append.
<span class="lineNum">    3452 </span>            :        *  @param __last  Iterator marking the end of the range.
<span class="lineNum">    3453 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3454 </span>            :        *
<span class="lineNum">    3455 </span>            :        *  Appends characters in the range [__first,__last) to this string.
<span class="lineNum">    3456 </span>            :        */
<span class="lineNum">    3457 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    3458 </span>            :         basic_string&amp;
<span class="lineNum">    3459 </span>            :         append(_InputIterator __first, _InputIterator __last)
<span class="lineNum">    3460 </span>            :         { return this-&gt;replace(_M_iend(), _M_iend(), __first, __last); }
<span class="lineNum">    3461 </span>            : 
<span class="lineNum">    3462 </span>            :       /**
<span class="lineNum">    3463 </span>            :        *  @brief  Append a single character.
<span class="lineNum">    3464 </span>            :        *  @param __c  Character to append.
<span class="lineNum">    3465 </span>            :        */
<span class="lineNum">    3466 </span>            :       void
<span class="lineNum">    3467 </span>            :       push_back(_CharT __c)
<span class="lineNum">    3468 </span>            :       { 
<span class="lineNum">    3469 </span>            :         const size_type __len = 1 + this-&gt;size();
<span class="lineNum">    3470 </span>            :         if (__len &gt; this-&gt;capacity() || _M_rep()-&gt;_M_is_shared())
<span class="lineNum">    3471 </span>            :           this-&gt;reserve(__len);
<span class="lineNum">    3472 </span>            :         traits_type::assign(_M_data()[this-&gt;size()], __c);
<span class="lineNum">    3473 </span>            :         _M_rep()-&gt;_M_set_length_and_sharable(__len);
<span class="lineNum">    3474 </span>            :       }
<span class="lineNum">    3475 </span>            : 
<span class="lineNum">    3476 </span>            :       /**
<span class="lineNum">    3477 </span>            :        *  @brief  Set value to contents of another string.
<span class="lineNum">    3478 </span>            :        *  @param  __str  Source string to use.
<span class="lineNum">    3479 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3480 </span>            :        */
<span class="lineNum">    3481 </span>            :       basic_string&amp;
<span class="lineNum">    3482 </span>            :       assign(const basic_string&amp; __str);
<span class="lineNum">    3483 </span>            : 
<span class="lineNum">    3484 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3485 </span>            :       /**
<span class="lineNum">    3486 </span>            :        *  @brief  Set value to contents of another string.
<span class="lineNum">    3487 </span>            :        *  @param  __str  Source string to use.
<span class="lineNum">    3488 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3489 </span>            :        *
<span class="lineNum">    3490 </span>            :        *  This function sets this string to the exact contents of @a __str.
<span class="lineNum">    3491 </span>            :        *  @a __str is a valid, but unspecified string.
<span class="lineNum">    3492 </span>            :        */
<span class="lineNum">    3493 </span>            :       // PR 58265, this should be noexcept.
<span class="lineNum">    3494 </span>            :       basic_string&amp;
<span class="lineNum">    3495 </span>            :       assign(basic_string&amp;&amp; __str)
<span class="lineNum">    3496 </span>            :       {
<span class="lineNum">    3497 </span>            :         this-&gt;swap(__str);
<span class="lineNum">    3498 </span>            :         return *this;
<span class="lineNum">    3499 </span>            :       }
<span class="lineNum">    3500 </span>            : #endif // C++11
<span class="lineNum">    3501 </span>            : 
<span class="lineNum">    3502 </span>            :       /**
<span class="lineNum">    3503 </span>            :        *  @brief  Set value to a substring of a string.
<span class="lineNum">    3504 </span>            :        *  @param __str  The string to use.
<span class="lineNum">    3505 </span>            :        *  @param __pos  Index of the first character of str.
<span class="lineNum">    3506 </span>            :        *  @param __n  Number of characters to use.
<span class="lineNum">    3507 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3508 </span>            :        *  @throw  std::out_of_range if @a pos is not a valid index.
<span class="lineNum">    3509 </span>            :        *
<span class="lineNum">    3510 </span>            :        *  This function sets this string to the substring of @a __str
<span class="lineNum">    3511 </span>            :        *  consisting of @a __n characters at @a __pos.  If @a __n is
<span class="lineNum">    3512 </span>            :        *  is larger than the number of available characters in @a
<span class="lineNum">    3513 </span>            :        *  __str, the remainder of @a __str is used.
<span class="lineNum">    3514 </span>            :        */
<span class="lineNum">    3515 </span>            :       basic_string&amp;
<span class="lineNum">    3516 </span>            :       assign(const basic_string&amp; __str, size_type __pos, size_type __n)
<span class="lineNum">    3517 </span>            :       { return this-&gt;assign(__str._M_data()
<span class="lineNum">    3518 </span>            :                             + __str._M_check(__pos, &quot;basic_string::assign&quot;),
<span class="lineNum">    3519 </span>            :                             __str._M_limit(__pos, __n)); }
<span class="lineNum">    3520 </span>            : 
<span class="lineNum">    3521 </span>            :       /**
<span class="lineNum">    3522 </span>            :        *  @brief  Set value to a C substring.
<span class="lineNum">    3523 </span>            :        *  @param __s  The C string to use.
<span class="lineNum">    3524 </span>            :        *  @param __n  Number of characters to use.
<span class="lineNum">    3525 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3526 </span>            :        *
<span class="lineNum">    3527 </span>            :        *  This function sets the value of this string to the first @a __n
<span class="lineNum">    3528 </span>            :        *  characters of @a __s.  If @a __n is is larger than the number of
<span class="lineNum">    3529 </span>            :        *  available characters in @a __s, the remainder of @a __s is used.
<span class="lineNum">    3530 </span>            :        */
<span class="lineNum">    3531 </span>            :       basic_string&amp;
<span class="lineNum">    3532 </span>            :       assign(const _CharT* __s, size_type __n);
<span class="lineNum">    3533 </span>            : 
<span class="lineNum">    3534 </span>            :       /**
<span class="lineNum">    3535 </span>            :        *  @brief  Set value to contents of a C string.
<span class="lineNum">    3536 </span>            :        *  @param __s  The C string to use.
<span class="lineNum">    3537 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3538 </span>            :        *
<span class="lineNum">    3539 </span>            :        *  This function sets the value of this string to the value of @a __s.
<span class="lineNum">    3540 </span>            :        *  The data is copied, so there is no dependence on @a __s once the
<span class="lineNum">    3541 </span>            :        *  function returns.
<span class="lineNum">    3542 </span>            :        */
<span class="lineNum">    3543 </span>            :       basic_string&amp;
<span class="lineNum">    3544 </span>            :       assign(const _CharT* __s)
<span class="lineNum">    3545 </span>            :       {
<span class="lineNum">    3546 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    3547 </span>            :         return this-&gt;assign(__s, traits_type::length(__s));
<span class="lineNum">    3548 </span>            :       }
<span class="lineNum">    3549 </span>            : 
<span class="lineNum">    3550 </span>            :       /**
<span class="lineNum">    3551 </span>            :        *  @brief  Set value to multiple characters.
<span class="lineNum">    3552 </span>            :        *  @param __n  Length of the resulting string.
<span class="lineNum">    3553 </span>            :        *  @param __c  The character to use.
<span class="lineNum">    3554 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3555 </span>            :        *
<span class="lineNum">    3556 </span>            :        *  This function sets the value of this string to @a __n copies of
<span class="lineNum">    3557 </span>            :        *  character @a __c.
<span class="lineNum">    3558 </span>            :        */
<span class="lineNum">    3559 </span>            :       basic_string&amp;
<span class="lineNum">    3560 </span>            :       assign(size_type __n, _CharT __c)
<span class="lineNum">    3561 </span>            :       { return _M_replace_aux(size_type(0), this-&gt;size(), __n, __c); }
<span class="lineNum">    3562 </span>            : 
<span class="lineNum">    3563 </span>            :       /**
<span class="lineNum">    3564 </span>            :        *  @brief  Set value to a range of characters.
<span class="lineNum">    3565 </span>            :        *  @param __first  Iterator referencing the first character to append.
<span class="lineNum">    3566 </span>            :        *  @param __last  Iterator marking the end of the range.
<span class="lineNum">    3567 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3568 </span>            :        *
<span class="lineNum">    3569 </span>            :        *  Sets value of string to characters in the range [__first,__last).
<span class="lineNum">    3570 </span>            :       */
<span class="lineNum">    3571 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    3572 </span>            :         basic_string&amp;
<span class="lineNum">    3573 </span>            :         assign(_InputIterator __first, _InputIterator __last)
<span class="lineNum">    3574 </span>            :         { return this-&gt;replace(_M_ibegin(), _M_iend(), __first, __last); }
<span class="lineNum">    3575 </span>            : 
<span class="lineNum">    3576 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3577 </span>            :       /**
<span class="lineNum">    3578 </span>            :        *  @brief  Set value to an initializer_list of characters.
<span class="lineNum">    3579 </span>            :        *  @param __l  The initializer_list of characters to assign.
<span class="lineNum">    3580 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3581 </span>            :        */
<span class="lineNum">    3582 </span>            :       basic_string&amp;
<span class="lineNum">    3583 </span>            :       assign(initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    3584 </span>            :       { return this-&gt;assign(__l.begin(), __l.size()); }
<span class="lineNum">    3585 </span>            : #endif // C++11
<span class="lineNum">    3586 </span>            : 
<span class="lineNum">    3587 </span>            :       /**
<span class="lineNum">    3588 </span>            :        *  @brief  Insert multiple characters.
<span class="lineNum">    3589 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    3590 </span>            :        *  @param __n  Number of characters to insert
<span class="lineNum">    3591 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    3592 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3593 </span>            :        *
<span class="lineNum">    3594 </span>            :        *  Inserts @a __n copies of character @a __c starting at the
<span class="lineNum">    3595 </span>            :        *  position referenced by iterator @a __p.  If adding
<span class="lineNum">    3596 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    3597 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    3598 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3599 </span>            :       */
<span class="lineNum">    3600 </span>            :       void
<span class="lineNum">    3601 </span>            :       insert(iterator __p, size_type __n, _CharT __c)
<span class="lineNum">    3602 </span>            :       { this-&gt;replace(__p, __p, __n, __c);  }
<span class="lineNum">    3603 </span>            : 
<span class="lineNum">    3604 </span>            :       /**
<span class="lineNum">    3605 </span>            :        *  @brief  Insert a range of characters.
<span class="lineNum">    3606 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    3607 </span>            :        *  @param __beg  Start of range.
<span class="lineNum">    3608 </span>            :        *  @param __end  End of range.
<span class="lineNum">    3609 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3610 </span>            :        *
<span class="lineNum">    3611 </span>            :        *  Inserts characters in range [__beg,__end).  If adding
<span class="lineNum">    3612 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    3613 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    3614 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3615 </span>            :       */
<span class="lineNum">    3616 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    3617 </span>            :         void
<span class="lineNum">    3618 </span>            :         insert(iterator __p, _InputIterator __beg, _InputIterator __end)
<span class="lineNum">    3619 </span>            :         { this-&gt;replace(__p, __p, __beg, __end); }
<span class="lineNum">    3620 </span>            : 
<span class="lineNum">    3621 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3622 </span>            :       /**
<span class="lineNum">    3623 </span>            :        *  @brief  Insert an initializer_list of characters.
<span class="lineNum">    3624 </span>            :        *  @param __p  Iterator referencing location in string to insert at.
<span class="lineNum">    3625 </span>            :        *  @param __l  The initializer_list of characters to insert.
<span class="lineNum">    3626 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3627 </span>            :        */
<span class="lineNum">    3628 </span>            :       void
<span class="lineNum">    3629 </span>            :       insert(iterator __p, initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    3630 </span>            :       {
<span class="lineNum">    3631 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= _M_ibegin() &amp;&amp; __p &lt;= _M_iend());
<span class="lineNum">    3632 </span>            :         this-&gt;insert(__p - _M_ibegin(), __l.begin(), __l.size());
<span class="lineNum">    3633 </span>            :       }
<span class="lineNum">    3634 </span>            : #endif // C++11
<span class="lineNum">    3635 </span>            : 
<span class="lineNum">    3636 </span>            :       /**
<span class="lineNum">    3637 </span>            :        *  @brief  Insert value of a string.
<span class="lineNum">    3638 </span>            :        *  @param __pos1  Iterator referencing location in string to insert at.
<span class="lineNum">    3639 </span>            :        *  @param __str  The string to insert.
<span class="lineNum">    3640 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3641 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3642 </span>            :        *
<span class="lineNum">    3643 </span>            :        *  Inserts value of @a __str starting at @a __pos1.  If adding
<span class="lineNum">    3644 </span>            :        *  characters causes the length to exceed max_size(),
<span class="lineNum">    3645 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    3646 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3647 </span>            :       */
<span class="lineNum">    3648 </span>            :       basic_string&amp;
<span class="lineNum">    3649 </span>            :       insert(size_type __pos1, const basic_string&amp; __str)
<span class="lineNum">    3650 </span>            :       { return this-&gt;insert(__pos1, __str, size_type(0), __str.size()); }
<span class="lineNum">    3651 </span>            : 
<span class="lineNum">    3652 </span>            :       /**
<span class="lineNum">    3653 </span>            :        *  @brief  Insert a substring.
<span class="lineNum">    3654 </span>            :        *  @param __pos1  Iterator referencing location in string to insert at.
<span class="lineNum">    3655 </span>            :        *  @param __str  The string to insert.
<span class="lineNum">    3656 </span>            :        *  @param __pos2  Start of characters in str to insert.
<span class="lineNum">    3657 </span>            :        *  @param __n  Number of characters to insert.
<span class="lineNum">    3658 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3659 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3660 </span>            :        *  @throw  std::out_of_range  If @a pos1 &gt; size() or
<span class="lineNum">    3661 </span>            :        *  @a __pos2 &gt; @a str.size().
<span class="lineNum">    3662 </span>            :        *
<span class="lineNum">    3663 </span>            :        *  Starting at @a pos1, insert @a __n character of @a __str
<span class="lineNum">    3664 </span>            :        *  beginning with @a __pos2.  If adding characters causes the
<span class="lineNum">    3665 </span>            :        *  length to exceed max_size(), length_error is thrown.  If @a
<span class="lineNum">    3666 </span>            :        *  __pos1 is beyond the end of this string or @a __pos2 is
<span class="lineNum">    3667 </span>            :        *  beyond the end of @a __str, out_of_range is thrown.  The
<span class="lineNum">    3668 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    3669 </span>            :       */
<span class="lineNum">    3670 </span>            :       basic_string&amp;
<span class="lineNum">    3671 </span>            :       insert(size_type __pos1, const basic_string&amp; __str,
<span class="lineNum">    3672 </span>            :              size_type __pos2, size_type __n)
<span class="lineNum">    3673 </span>            :       { return this-&gt;insert(__pos1, __str._M_data()
<span class="lineNum">    3674 </span>            :                             + __str._M_check(__pos2, &quot;basic_string::insert&quot;),
<span class="lineNum">    3675 </span>            :                             __str._M_limit(__pos2, __n)); }
<span class="lineNum">    3676 </span>            : 
<span class="lineNum">    3677 </span>            :       /**
<span class="lineNum">    3678 </span>            :        *  @brief  Insert a C substring.
<span class="lineNum">    3679 </span>            :        *  @param __pos  Iterator referencing location in string to insert at.
<span class="lineNum">    3680 </span>            :        *  @param __s  The C string to insert.
<span class="lineNum">    3681 </span>            :        *  @param __n  The number of characters to insert.
<span class="lineNum">    3682 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3683 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3684 </span>            :        *  @throw  std::out_of_range  If @a __pos is beyond the end of this
<span class="lineNum">    3685 </span>            :        *  string.
<span class="lineNum">    3686 </span>            :        *
<span class="lineNum">    3687 </span>            :        *  Inserts the first @a __n characters of @a __s starting at @a
<span class="lineNum">    3688 </span>            :        *  __pos.  If adding characters causes the length to exceed
<span class="lineNum">    3689 </span>            :        *  max_size(), length_error is thrown.  If @a __pos is beyond
<span class="lineNum">    3690 </span>            :        *  end(), out_of_range is thrown.  The value of the string
<span class="lineNum">    3691 </span>            :        *  doesn't change if an error is thrown.
<span class="lineNum">    3692 </span>            :       */
<span class="lineNum">    3693 </span>            :       basic_string&amp;
<span class="lineNum">    3694 </span>            :       insert(size_type __pos, const _CharT* __s, size_type __n);
<span class="lineNum">    3695 </span>            : 
<span class="lineNum">    3696 </span>            :       /**
<span class="lineNum">    3697 </span>            :        *  @brief  Insert a C string.
<span class="lineNum">    3698 </span>            :        *  @param __pos  Iterator referencing location in string to insert at.
<span class="lineNum">    3699 </span>            :        *  @param __s  The C string to insert.
<span class="lineNum">    3700 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3701 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3702 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    3703 </span>            :        *  string.
<span class="lineNum">    3704 </span>            :        *
<span class="lineNum">    3705 </span>            :        *  Inserts the first @a n characters of @a __s starting at @a __pos.  If
<span class="lineNum">    3706 </span>            :        *  adding characters causes the length to exceed max_size(),
<span class="lineNum">    3707 </span>            :        *  length_error is thrown.  If @a __pos is beyond end(), out_of_range is
<span class="lineNum">    3708 </span>            :        *  thrown.  The value of the string doesn't change if an error is
<span class="lineNum">    3709 </span>            :        *  thrown.
<span class="lineNum">    3710 </span>            :       */
<span class="lineNum">    3711 </span>            :       basic_string&amp;
<span class="lineNum">    3712 </span>            :       insert(size_type __pos, const _CharT* __s)
<span class="lineNum">    3713 </span>            :       {
<span class="lineNum">    3714 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    3715 </span>            :         return this-&gt;insert(__pos, __s, traits_type::length(__s));
<span class="lineNum">    3716 </span>            :       }
<span class="lineNum">    3717 </span>            : 
<span class="lineNum">    3718 </span>            :       /**
<span class="lineNum">    3719 </span>            :        *  @brief  Insert multiple characters.
<span class="lineNum">    3720 </span>            :        *  @param __pos  Index in string to insert at.
<span class="lineNum">    3721 </span>            :        *  @param __n  Number of characters to insert
<span class="lineNum">    3722 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    3723 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3724 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3725 </span>            :        *  @throw  std::out_of_range  If @a __pos is beyond the end of this
<span class="lineNum">    3726 </span>            :        *  string.
<span class="lineNum">    3727 </span>            :        *
<span class="lineNum">    3728 </span>            :        *  Inserts @a __n copies of character @a __c starting at index
<span class="lineNum">    3729 </span>            :        *  @a __pos.  If adding characters causes the length to exceed
<span class="lineNum">    3730 </span>            :        *  max_size(), length_error is thrown.  If @a __pos &gt; length(),
<span class="lineNum">    3731 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    3732 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3733 </span>            :       */
<span class="lineNum">    3734 </span>            :       basic_string&amp;
<span class="lineNum">    3735 </span>            :       insert(size_type __pos, size_type __n, _CharT __c)
<span class="lineNum">    3736 </span>            :       { return _M_replace_aux(_M_check(__pos, &quot;basic_string::insert&quot;),
<span class="lineNum">    3737 </span>            :                               size_type(0), __n, __c); }
<span class="lineNum">    3738 </span>            : 
<span class="lineNum">    3739 </span>            :       /**
<span class="lineNum">    3740 </span>            :        *  @brief  Insert one character.
<span class="lineNum">    3741 </span>            :        *  @param __p  Iterator referencing position in string to insert at.
<span class="lineNum">    3742 </span>            :        *  @param __c  The character to insert.
<span class="lineNum">    3743 </span>            :        *  @return  Iterator referencing newly inserted char.
<span class="lineNum">    3744 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3745 </span>            :        *
<span class="lineNum">    3746 </span>            :        *  Inserts character @a __c at position referenced by @a __p.
<span class="lineNum">    3747 </span>            :        *  If adding character causes the length to exceed max_size(),
<span class="lineNum">    3748 </span>            :        *  length_error is thrown.  If @a __p is beyond end of string,
<span class="lineNum">    3749 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    3750 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3751 </span>            :       */
<span class="lineNum">    3752 </span>            :       iterator
<span class="lineNum">    3753 </span>            :       insert(iterator __p, _CharT __c)
<span class="lineNum">    3754 </span>            :       {
<span class="lineNum">    3755 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__p &gt;= _M_ibegin() &amp;&amp; __p &lt;= _M_iend());
<span class="lineNum">    3756 </span>            :         const size_type __pos = __p - _M_ibegin();
<span class="lineNum">    3757 </span>            :         _M_replace_aux(__pos, size_type(0), size_type(1), __c);
<span class="lineNum">    3758 </span>            :         _M_rep()-&gt;_M_set_leaked();
<span class="lineNum">    3759 </span>            :         return iterator(_M_data() + __pos);
<span class="lineNum">    3760 </span>            :       }
<span class="lineNum">    3761 </span>            : 
<span class="lineNum">    3762 </span>            :       /**
<span class="lineNum">    3763 </span>            :        *  @brief  Remove characters.
<span class="lineNum">    3764 </span>            :        *  @param __pos  Index of first character to remove (default 0).
<span class="lineNum">    3765 </span>            :        *  @param __n  Number of characters to remove (default remainder).
<span class="lineNum">    3766 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3767 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    3768 </span>            :        *  string.
<span class="lineNum">    3769 </span>            :        *
<span class="lineNum">    3770 </span>            :        *  Removes @a __n characters from this string starting at @a
<span class="lineNum">    3771 </span>            :        *  __pos.  The length of the string is reduced by @a __n.  If
<span class="lineNum">    3772 </span>            :        *  there are &lt; @a __n characters to remove, the remainder of
<span class="lineNum">    3773 </span>            :        *  the string is truncated.  If @a __p is beyond end of string,
<span class="lineNum">    3774 </span>            :        *  out_of_range is thrown.  The value of the string doesn't
<span class="lineNum">    3775 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3776 </span>            :       */
<span class="lineNum">    3777 </span>            :       basic_string&amp;
<span class="lineNum">    3778 </span>            :       erase(size_type __pos = 0, size_type __n = npos)
<span class="lineNum">    3779 </span>            :       { 
<span class="lineNum">    3780 </span>            :         _M_mutate(_M_check(__pos, &quot;basic_string::erase&quot;),
<span class="lineNum">    3781 </span>            :                   _M_limit(__pos, __n), size_type(0));
<span class="lineNum">    3782 </span>            :         return *this;
<span class="lineNum">    3783 </span>            :       }
<span class="lineNum">    3784 </span>            : 
<span class="lineNum">    3785 </span>            :       /**
<span class="lineNum">    3786 </span>            :        *  @brief  Remove one character.
<span class="lineNum">    3787 </span>            :        *  @param __position  Iterator referencing the character to remove.
<span class="lineNum">    3788 </span>            :        *  @return  iterator referencing same location after removal.
<span class="lineNum">    3789 </span>            :        *
<span class="lineNum">    3790 </span>            :        *  Removes the character at @a __position from this string. The value
<span class="lineNum">    3791 </span>            :        *  of the string doesn't change if an error is thrown.
<span class="lineNum">    3792 </span>            :       */
<span class="lineNum">    3793 </span>            :       iterator
<span class="lineNum">    3794 </span>            :       erase(iterator __position)
<span class="lineNum">    3795 </span>            :       {
<span class="lineNum">    3796 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(__position &gt;= _M_ibegin()
<span class="lineNum">    3797 </span>            :                                  &amp;&amp; __position &lt; _M_iend());
<span class="lineNum">    3798 </span>            :         const size_type __pos = __position - _M_ibegin();
<span class="lineNum">    3799 </span>            :         _M_mutate(__pos, size_type(1), size_type(0));
<span class="lineNum">    3800 </span>            :         _M_rep()-&gt;_M_set_leaked();
<span class="lineNum">    3801 </span>            :         return iterator(_M_data() + __pos);
<span class="lineNum">    3802 </span>            :       }
<span class="lineNum">    3803 </span>            : 
<span class="lineNum">    3804 </span>            :       /**
<span class="lineNum">    3805 </span>            :        *  @brief  Remove a range of characters.
<span class="lineNum">    3806 </span>            :        *  @param __first  Iterator referencing the first character to remove.
<span class="lineNum">    3807 </span>            :        *  @param __last  Iterator referencing the end of the range.
<span class="lineNum">    3808 </span>            :        *  @return  Iterator referencing location of first after removal.
<span class="lineNum">    3809 </span>            :        *
<span class="lineNum">    3810 </span>            :        *  Removes the characters in the range [first,last) from this string.
<span class="lineNum">    3811 </span>            :        *  The value of the string doesn't change if an error is thrown.
<span class="lineNum">    3812 </span>            :       */
<span class="lineNum">    3813 </span>            :       iterator
<span class="lineNum">    3814 </span>            :       erase(iterator __first, iterator __last);
<span class="lineNum">    3815 </span>            :  
<span class="lineNum">    3816 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    3817 </span>            :       /**
<span class="lineNum">    3818 </span>            :        *  @brief  Remove the last character.
<span class="lineNum">    3819 </span>            :        *
<span class="lineNum">    3820 </span>            :        *  The string must be non-empty.
<span class="lineNum">    3821 </span>            :        */
<span class="lineNum">    3822 </span>            :       void
<span class="lineNum">    3823 </span>            :       pop_back() // FIXME C++11: should be noexcept.
<span class="lineNum">    3824 </span>            :       { erase(size()-1, 1); }
<span class="lineNum">    3825 </span>            : #endif // C++11
<span class="lineNum">    3826 </span>            : 
<span class="lineNum">    3827 </span>            :       /**
<span class="lineNum">    3828 </span>            :        *  @brief  Replace characters with value from another string.
<span class="lineNum">    3829 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    3830 </span>            :        *  @param __n  Number of characters to be replaced.
<span class="lineNum">    3831 </span>            :        *  @param __str  String to insert.
<span class="lineNum">    3832 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3833 </span>            :        *  @throw  std::out_of_range  If @a pos is beyond the end of this
<span class="lineNum">    3834 </span>            :        *  string.
<span class="lineNum">    3835 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3836 </span>            :        *
<span class="lineNum">    3837 </span>            :        *  Removes the characters in the range [__pos,__pos+__n) from
<span class="lineNum">    3838 </span>            :        *  this string.  In place, the value of @a __str is inserted.
<span class="lineNum">    3839 </span>            :        *  If @a __pos is beyond end of string, out_of_range is thrown.
<span class="lineNum">    3840 </span>            :        *  If the length of the result exceeds max_size(), length_error
<span class="lineNum">    3841 </span>            :        *  is thrown.  The value of the string doesn't change if an
<span class="lineNum">    3842 </span>            :        *  error is thrown.
<span class="lineNum">    3843 </span>            :       */
<span class="lineNum">    3844 </span>            :       basic_string&amp;
<span class="lineNum">    3845 </span>            :       replace(size_type __pos, size_type __n, const basic_string&amp; __str)
<span class="lineNum">    3846 </span>            :       { return this-&gt;replace(__pos, __n, __str._M_data(), __str.size()); }
<span class="lineNum">    3847 </span>            : 
<span class="lineNum">    3848 </span>            :       /**
<span class="lineNum">    3849 </span>            :        *  @brief  Replace characters with value from another string.
<span class="lineNum">    3850 </span>            :        *  @param __pos1  Index of first character to replace.
<span class="lineNum">    3851 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    3852 </span>            :        *  @param __str  String to insert.
<span class="lineNum">    3853 </span>            :        *  @param __pos2  Index of first character of str to use.
<span class="lineNum">    3854 </span>            :        *  @param __n2  Number of characters from str to use.
<span class="lineNum">    3855 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3856 </span>            :        *  @throw  std::out_of_range  If @a __pos1 &gt; size() or @a __pos2 &gt;
<span class="lineNum">    3857 </span>            :        *  __str.size().
<span class="lineNum">    3858 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3859 </span>            :        *
<span class="lineNum">    3860 </span>            :        *  Removes the characters in the range [__pos1,__pos1 + n) from this
<span class="lineNum">    3861 </span>            :        *  string.  In place, the value of @a __str is inserted.  If @a __pos is
<span class="lineNum">    3862 </span>            :        *  beyond end of string, out_of_range is thrown.  If the length of the
<span class="lineNum">    3863 </span>            :        *  result exceeds max_size(), length_error is thrown.  The value of the
<span class="lineNum">    3864 </span>            :        *  string doesn't change if an error is thrown.
<span class="lineNum">    3865 </span>            :       */
<span class="lineNum">    3866 </span>            :       basic_string&amp;
<span class="lineNum">    3867 </span>            :       replace(size_type __pos1, size_type __n1, const basic_string&amp; __str,
<span class="lineNum">    3868 </span>            :               size_type __pos2, size_type __n2)
<span class="lineNum">    3869 </span>            :       { return this-&gt;replace(__pos1, __n1, __str._M_data()
<span class="lineNum">    3870 </span>            :                              + __str._M_check(__pos2, &quot;basic_string::replace&quot;),
<span class="lineNum">    3871 </span>            :                              __str._M_limit(__pos2, __n2)); }
<span class="lineNum">    3872 </span>            : 
<span class="lineNum">    3873 </span>            :       /**
<span class="lineNum">    3874 </span>            :        *  @brief  Replace characters with value of a C substring.
<span class="lineNum">    3875 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    3876 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    3877 </span>            :        *  @param __s  C string to insert.
<span class="lineNum">    3878 </span>            :        *  @param __n2  Number of characters from @a s to use.
<span class="lineNum">    3879 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3880 </span>            :        *  @throw  std::out_of_range  If @a pos1 &gt; size().
<span class="lineNum">    3881 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3882 </span>            :        *
<span class="lineNum">    3883 </span>            :        *  Removes the characters in the range [__pos,__pos + __n1)
<span class="lineNum">    3884 </span>            :        *  from this string.  In place, the first @a __n2 characters of
<span class="lineNum">    3885 </span>            :        *  @a __s are inserted, or all of @a __s if @a __n2 is too large.  If
<span class="lineNum">    3886 </span>            :        *  @a __pos is beyond end of string, out_of_range is thrown.  If
<span class="lineNum">    3887 </span>            :        *  the length of result exceeds max_size(), length_error is
<span class="lineNum">    3888 </span>            :        *  thrown.  The value of the string doesn't change if an error
<span class="lineNum">    3889 </span>            :        *  is thrown.
<span class="lineNum">    3890 </span>            :       */
<span class="lineNum">    3891 </span>            :       basic_string&amp;
<span class="lineNum">    3892 </span>            :       replace(size_type __pos, size_type __n1, const _CharT* __s,
<span class="lineNum">    3893 </span>            :               size_type __n2);
<span class="lineNum">    3894 </span>            : 
<span class="lineNum">    3895 </span>            :       /**
<span class="lineNum">    3896 </span>            :        *  @brief  Replace characters with value of a C string.
<span class="lineNum">    3897 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    3898 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    3899 </span>            :        *  @param __s  C string to insert.
<span class="lineNum">    3900 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3901 </span>            :        *  @throw  std::out_of_range  If @a pos &gt; size().
<span class="lineNum">    3902 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3903 </span>            :        *
<span class="lineNum">    3904 </span>            :        *  Removes the characters in the range [__pos,__pos + __n1)
<span class="lineNum">    3905 </span>            :        *  from this string.  In place, the characters of @a __s are
<span class="lineNum">    3906 </span>            :        *  inserted.  If @a __pos is beyond end of string, out_of_range
<span class="lineNum">    3907 </span>            :        *  is thrown.  If the length of result exceeds max_size(),
<span class="lineNum">    3908 </span>            :        *  length_error is thrown.  The value of the string doesn't
<span class="lineNum">    3909 </span>            :        *  change if an error is thrown.
<span class="lineNum">    3910 </span>            :       */
<span class="lineNum">    3911 </span>            :       basic_string&amp;
<span class="lineNum">    3912 </span>            :       replace(size_type __pos, size_type __n1, const _CharT* __s)
<span class="lineNum">    3913 </span>            :       {
<span class="lineNum">    3914 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    3915 </span>            :         return this-&gt;replace(__pos, __n1, __s, traits_type::length(__s));
<span class="lineNum">    3916 </span>            :       }
<span class="lineNum">    3917 </span>            : 
<span class="lineNum">    3918 </span>            :       /**
<span class="lineNum">    3919 </span>            :        *  @brief  Replace characters with multiple characters.
<span class="lineNum">    3920 </span>            :        *  @param __pos  Index of first character to replace.
<span class="lineNum">    3921 </span>            :        *  @param __n1  Number of characters to be replaced.
<span class="lineNum">    3922 </span>            :        *  @param __n2  Number of characters to insert.
<span class="lineNum">    3923 </span>            :        *  @param __c  Character to insert.
<span class="lineNum">    3924 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3925 </span>            :        *  @throw  std::out_of_range  If @a __pos &gt; size().
<span class="lineNum">    3926 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3927 </span>            :        *
<span class="lineNum">    3928 </span>            :        *  Removes the characters in the range [pos,pos + n1) from this
<span class="lineNum">    3929 </span>            :        *  string.  In place, @a __n2 copies of @a __c are inserted.
<span class="lineNum">    3930 </span>            :        *  If @a __pos is beyond end of string, out_of_range is thrown.
<span class="lineNum">    3931 </span>            :        *  If the length of result exceeds max_size(), length_error is
<span class="lineNum">    3932 </span>            :        *  thrown.  The value of the string doesn't change if an error
<span class="lineNum">    3933 </span>            :        *  is thrown.
<span class="lineNum">    3934 </span>            :       */
<span class="lineNum">    3935 </span>            :       basic_string&amp;
<span class="lineNum">    3936 </span>            :       replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
<span class="lineNum">    3937 </span>            :       { return _M_replace_aux(_M_check(__pos, &quot;basic_string::replace&quot;),
<span class="lineNum">    3938 </span>            :                               _M_limit(__pos, __n1), __n2, __c); }
<span class="lineNum">    3939 </span>            : 
<span class="lineNum">    3940 </span>            :       /**
<span class="lineNum">    3941 </span>            :        *  @brief  Replace range of characters with string.
<span class="lineNum">    3942 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    3943 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    3944 </span>            :        *  @param __str  String value to insert.
<span class="lineNum">    3945 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3946 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3947 </span>            :        *
<span class="lineNum">    3948 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    3949 </span>            :        *  the value of @a __str is inserted.  If the length of result
<span class="lineNum">    3950 </span>            :        *  exceeds max_size(), length_error is thrown.  The value of
<span class="lineNum">    3951 </span>            :        *  the string doesn't change if an error is thrown.
<span class="lineNum">    3952 </span>            :       */
<span class="lineNum">    3953 </span>            :       basic_string&amp;
<span class="lineNum">    3954 </span>            :       replace(iterator __i1, iterator __i2, const basic_string&amp; __str)
<span class="lineNum">    3955 </span>            :       { return this-&gt;replace(__i1, __i2, __str._M_data(), __str.size()); }
<span class="lineNum">    3956 </span>            : 
<span class="lineNum">    3957 </span>            :       /**
<span class="lineNum">    3958 </span>            :        *  @brief  Replace range of characters with C substring.
<span class="lineNum">    3959 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    3960 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    3961 </span>            :        *  @param __s  C string value to insert.
<span class="lineNum">    3962 </span>            :        *  @param __n  Number of characters from s to insert.
<span class="lineNum">    3963 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3964 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3965 </span>            :        *
<span class="lineNum">    3966 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    3967 </span>            :        *  the first @a __n characters of @a __s are inserted.  If the
<span class="lineNum">    3968 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    3969 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    3970 </span>            :        *  thrown.
<span class="lineNum">    3971 </span>            :       */
<span class="lineNum">    3972 </span>            :       basic_string&amp;
<span class="lineNum">    3973 </span>            :       replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
<span class="lineNum">    3974 </span>            :       {
<span class="lineNum">    3975 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    3976 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    3977 </span>            :         return this-&gt;replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
<span class="lineNum">    3978 </span>            :       }
<span class="lineNum">    3979 </span>            : 
<span class="lineNum">    3980 </span>            :       /**
<span class="lineNum">    3981 </span>            :        *  @brief  Replace range of characters with C string.
<span class="lineNum">    3982 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    3983 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    3984 </span>            :        *  @param __s  C string value to insert.
<span class="lineNum">    3985 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    3986 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    3987 </span>            :        *
<span class="lineNum">    3988 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    3989 </span>            :        *  the characters of @a __s are inserted.  If the length of
<span class="lineNum">    3990 </span>            :        *  result exceeds max_size(), length_error is thrown.  The
<span class="lineNum">    3991 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    3992 </span>            :       */
<span class="lineNum">    3993 </span>            :       basic_string&amp;
<span class="lineNum">    3994 </span>            :       replace(iterator __i1, iterator __i2, const _CharT* __s)
<span class="lineNum">    3995 </span>            :       {
<span class="lineNum">    3996 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    3997 </span>            :         return this-&gt;replace(__i1, __i2, __s, traits_type::length(__s));
<span class="lineNum">    3998 </span>            :       }
<span class="lineNum">    3999 </span>            : 
<span class="lineNum">    4000 </span>            :       /**
<span class="lineNum">    4001 </span>            :        *  @brief  Replace range of characters with multiple characters
<span class="lineNum">    4002 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    4003 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    4004 </span>            :        *  @param __n  Number of characters to insert.
<span class="lineNum">    4005 </span>            :        *  @param __c  Character to insert.
<span class="lineNum">    4006 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    4007 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    4008 </span>            :        *
<span class="lineNum">    4009 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    4010 </span>            :        *  @a __n copies of @a __c are inserted.  If the length of
<span class="lineNum">    4011 </span>            :        *  result exceeds max_size(), length_error is thrown.  The
<span class="lineNum">    4012 </span>            :        *  value of the string doesn't change if an error is thrown.
<span class="lineNum">    4013 </span>            :       */
<span class="lineNum">    4014 </span>            :       basic_string&amp;
<span class="lineNum">    4015 </span>            :       replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
<span class="lineNum">    4016 </span>            :       {
<span class="lineNum">    4017 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4018 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4019 </span>            :         return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
<span class="lineNum">    4020 </span>            :       }
<span class="lineNum">    4021 </span>            : 
<span class="lineNum">    4022 </span>            :       /**
<span class="lineNum">    4023 </span>            :        *  @brief  Replace range of characters with range.
<span class="lineNum">    4024 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    4025 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    4026 </span>            :        *  @param __k1  Iterator referencing start of range to insert.
<span class="lineNum">    4027 </span>            :        *  @param __k2  Iterator referencing end of range to insert.
<span class="lineNum">    4028 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    4029 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    4030 </span>            :        *
<span class="lineNum">    4031 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    4032 </span>            :        *  characters in the range [__k1,__k2) are inserted.  If the
<span class="lineNum">    4033 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    4034 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    4035 </span>            :        *  thrown.
<span class="lineNum">    4036 </span>            :       */
<span class="lineNum">    4037 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    4038 </span>            :         basic_string&amp;
<span class="lineNum">    4039 </span>            :         replace(iterator __i1, iterator __i2,
<span class="lineNum">    4040 </span>            :                 _InputIterator __k1, _InputIterator __k2)
<span class="lineNum">    4041 </span>            :         {
<span class="lineNum">    4042 </span>            :           _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4043 </span>            :                                    &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4044 </span>            :           __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    4045 </span>            :           typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;
<span class="lineNum">    4046 </span>            :           return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
<span class="lineNum">    4047 </span>            :         }
<span class="lineNum">    4048 </span>            : 
<span class="lineNum">    4049 </span>            :       // Specializations for the common case of pointer and iterator:
<span class="lineNum">    4050 </span>            :       // useful to avoid the overhead of temporary buffering in _M_replace.
<span class="lineNum">    4051 </span>            :       basic_string&amp;
<span class="lineNum">    4052 </span>            :       replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
<span class="lineNum">    4053 </span>            :       {
<span class="lineNum">    4054 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4055 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4056 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    4057 </span>            :         return this-&gt;replace(__i1 - _M_ibegin(), __i2 - __i1,
<span class="lineNum">    4058 </span>            :                              __k1, __k2 - __k1);
<span class="lineNum">    4059 </span>            :       }
<span class="lineNum">    4060 </span>            : 
<span class="lineNum">    4061 </span>            :       basic_string&amp;
<span class="lineNum">    4062 </span>            :       replace(iterator __i1, iterator __i2,
<span class="lineNum">    4063 </span>            :               const _CharT* __k1, const _CharT* __k2)
<span class="lineNum">    4064 </span>            :       {
<span class="lineNum">    4065 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4066 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4067 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    4068 </span>            :         return this-&gt;replace(__i1 - _M_ibegin(), __i2 - __i1,
<span class="lineNum">    4069 </span>            :                              __k1, __k2 - __k1);
<span class="lineNum">    4070 </span>            :       }
<span class="lineNum">    4071 </span>            : 
<span class="lineNum">    4072 </span>            :       basic_string&amp;
<span class="lineNum">    4073 </span>            :       replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
<span class="lineNum">    4074 </span>            :       {
<span class="lineNum">    4075 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4076 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4077 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    4078 </span>            :         return this-&gt;replace(__i1 - _M_ibegin(), __i2 - __i1,
<span class="lineNum">    4079 </span>            :                              __k1.base(), __k2 - __k1);
<span class="lineNum">    4080 </span>            :       }
<span class="lineNum">    4081 </span>            : 
<span class="lineNum">    4082 </span>            :       basic_string&amp;
<span class="lineNum">    4083 </span>            :       replace(iterator __i1, iterator __i2,
<span class="lineNum">    4084 </span>            :               const_iterator __k1, const_iterator __k2)
<span class="lineNum">    4085 </span>            :       {
<span class="lineNum">    4086 </span>            :         _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() &lt;= __i1 &amp;&amp; __i1 &lt;= __i2
<span class="lineNum">    4087 </span>            :                                  &amp;&amp; __i2 &lt;= _M_iend());
<span class="lineNum">    4088 </span>            :         __glibcxx_requires_valid_range(__k1, __k2);
<span class="lineNum">    4089 </span>            :         return this-&gt;replace(__i1 - _M_ibegin(), __i2 - __i1,
<span class="lineNum">    4090 </span>            :                              __k1.base(), __k2 - __k1);
<span class="lineNum">    4091 </span>            :       }
<span class="lineNum">    4092 </span>            :       
<span class="lineNum">    4093 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    4094 </span>            :       /**
<span class="lineNum">    4095 </span>            :        *  @brief  Replace range of characters with initializer_list.
<span class="lineNum">    4096 </span>            :        *  @param __i1  Iterator referencing start of range to replace.
<span class="lineNum">    4097 </span>            :        *  @param __i2  Iterator referencing end of range to replace.
<span class="lineNum">    4098 </span>            :        *  @param __l  The initializer_list of characters to insert.
<span class="lineNum">    4099 </span>            :        *  @return  Reference to this string.
<span class="lineNum">    4100 </span>            :        *  @throw  std::length_error  If new length exceeds @c max_size().
<span class="lineNum">    4101 </span>            :        *
<span class="lineNum">    4102 </span>            :        *  Removes the characters in the range [__i1,__i2).  In place,
<span class="lineNum">    4103 </span>            :        *  characters in the range [__k1,__k2) are inserted.  If the
<span class="lineNum">    4104 </span>            :        *  length of result exceeds max_size(), length_error is thrown.
<span class="lineNum">    4105 </span>            :        *  The value of the string doesn't change if an error is
<span class="lineNum">    4106 </span>            :        *  thrown.
<span class="lineNum">    4107 </span>            :       */
<span class="lineNum">    4108 </span>            :       basic_string&amp; replace(iterator __i1, iterator __i2,
<span class="lineNum">    4109 </span>            :                             initializer_list&lt;_CharT&gt; __l)
<span class="lineNum">    4110 </span>            :       { return this-&gt;replace(__i1, __i2, __l.begin(), __l.end()); }
<span class="lineNum">    4111 </span>            : #endif // C++11
<span class="lineNum">    4112 </span>            : 
<span class="lineNum">    4113 </span>            :     private:
<span class="lineNum">    4114 </span>            :       template&lt;class _Integer&gt;
<span class="lineNum">    4115 </span>            :         basic_string&amp;
<span class="lineNum">    4116 </span>            :         _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
<span class="lineNum">    4117 </span>            :                             _Integer __val, __true_type)
<span class="lineNum">    4118 </span>            :         { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
<span class="lineNum">    4119 </span>            : 
<span class="lineNum">    4120 </span>            :       template&lt;class _InputIterator&gt;
<span class="lineNum">    4121 </span>            :         basic_string&amp;
<span class="lineNum">    4122 </span>            :         _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
<span class="lineNum">    4123 </span>            :                             _InputIterator __k2, __false_type);
<span class="lineNum">    4124 </span>            : 
<span class="lineNum">    4125 </span>            :       basic_string&amp;
<span class="lineNum">    4126 </span>            :       _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
<span class="lineNum">    4127 </span>            :                      _CharT __c);
<span class="lineNum">    4128 </span>            : 
<span class="lineNum">    4129 </span>            :       basic_string&amp;
<span class="lineNum">    4130 </span>            :       _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
<span class="lineNum">    4131 </span>            :                       size_type __n2);
<span class="lineNum">    4132 </span>            : 
<span class="lineNum">    4133 </span>            :       // _S_construct_aux is used to implement the 21.3.1 para 15 which
<span class="lineNum">    4134 </span>            :       // requires special behaviour if _InIter is an integral type
<span class="lineNum">    4135 </span>            :       template&lt;class _InIterator&gt;
<span class="lineNum">    4136 </span>            :         static _CharT*
<span class="lineNum">    4137 </span>            :         _S_construct_aux(_InIterator __beg, _InIterator __end,
<span class="lineNum">    4138 </span>            :                          const _Alloc&amp; __a, __false_type)
<span class="lineNum">    4139 </span>            :         {
<span class="lineNum">    4140 </span>            :           typedef typename iterator_traits&lt;_InIterator&gt;::iterator_category _Tag;
<span class="lineNum">    4141 </span>            :           return _S_construct(__beg, __end, __a, _Tag());
<span class="lineNum">    4142 </span>            :         }
<span class="lineNum">    4143 </span>            : 
<span class="lineNum">    4144 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    4145 </span>            :       // 438. Ambiguity in the &quot;do the right thing&quot; clause
<span class="lineNum">    4146 </span>            :       template&lt;class _Integer&gt;
<span class="lineNum">    4147 </span>            :         static _CharT*
<span class="lineNum">    4148 </span>            :         _S_construct_aux(_Integer __beg, _Integer __end,
<span class="lineNum">    4149 </span>            :                          const _Alloc&amp; __a, __true_type)
<span class="lineNum">    4150 </span>            :         { return _S_construct_aux_2(static_cast&lt;size_type&gt;(__beg),
<span class="lineNum">    4151 </span>            :                                     __end, __a); }
<span class="lineNum">    4152 </span>            : 
<span class="lineNum">    4153 </span>            :       static _CharT*
<span class="lineNum">    4154 </span>            :       _S_construct_aux_2(size_type __req, _CharT __c, const _Alloc&amp; __a)
<span class="lineNum">    4155 </span>            :       { return _S_construct(__req, __c, __a); }
<span class="lineNum">    4156 </span>            : 
<span class="lineNum">    4157 </span>            :       template&lt;class _InIterator&gt;
<span class="lineNum">    4158 </span>            :         static _CharT*
<span class="lineNum">    4159 </span>            :         _S_construct(_InIterator __beg, _InIterator __end, const _Alloc&amp; __a)
<span class="lineNum">    4160 </span>            :         {
<span class="lineNum">    4161 </span>            :           typedef typename std::__is_integer&lt;_InIterator&gt;::__type _Integral;
<span class="lineNum">    4162 </span>            :           return _S_construct_aux(__beg, __end, __a, _Integral());
<span class="lineNum">    4163 </span>            :         }
<span class="lineNum">    4164 </span>            : 
<span class="lineNum">    4165 </span>            :       // For Input Iterators, used in istreambuf_iterators, etc.
<span class="lineNum">    4166 </span>            :       template&lt;class _InIterator&gt;
<span class="lineNum">    4167 </span>            :         static _CharT*
<span class="lineNum">    4168 </span>            :          _S_construct(_InIterator __beg, _InIterator __end, const _Alloc&amp; __a,
<span class="lineNum">    4169 </span>            :                       input_iterator_tag);
<span class="lineNum">    4170 </span>            : 
<span class="lineNum">    4171 </span>            :       // For forward_iterators up to random_access_iterators, used for
<span class="lineNum">    4172 </span>            :       // string::iterator, _CharT*, etc.
<span class="lineNum">    4173 </span>            :       template&lt;class _FwdIterator&gt;
<span class="lineNum">    4174 </span>            :         static _CharT*
<span class="lineNum">    4175 </span>            :         _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc&amp; __a,
<span class="lineNum">    4176 </span>            :                      forward_iterator_tag);
<span class="lineNum">    4177 </span>            : 
<span class="lineNum">    4178 </span>            :       static _CharT*
<span class="lineNum">    4179 </span>            :       _S_construct(size_type __req, _CharT __c, const _Alloc&amp; __a);
<span class="lineNum">    4180 </span>            : 
<span class="lineNum">    4181 </span>            :     public:
<span class="lineNum">    4182 </span>            : 
<span class="lineNum">    4183 </span>            :       /**
<span class="lineNum">    4184 </span>            :        *  @brief  Copy substring into C string.
<span class="lineNum">    4185 </span>            :        *  @param __s  C string to copy value into.
<span class="lineNum">    4186 </span>            :        *  @param __n  Number of characters to copy.
<span class="lineNum">    4187 </span>            :        *  @param __pos  Index of first character to copy.
<span class="lineNum">    4188 </span>            :        *  @return  Number of characters actually copied
<span class="lineNum">    4189 </span>            :        *  @throw  std::out_of_range  If __pos &gt; size().
<span class="lineNum">    4190 </span>            :        *
<span class="lineNum">    4191 </span>            :        *  Copies up to @a __n characters starting at @a __pos into the
<span class="lineNum">    4192 </span>            :        *  C string @a __s.  If @a __pos is %greater than size(),
<span class="lineNum">    4193 </span>            :        *  out_of_range is thrown.
<span class="lineNum">    4194 </span>            :       */
<span class="lineNum">    4195 </span>            :       size_type
<span class="lineNum">    4196 </span>            :       copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
<span class="lineNum">    4197 </span>            : 
<span class="lineNum">    4198 </span>            :       /**
<span class="lineNum">    4199 </span>            :        *  @brief  Swap contents with another string.
<span class="lineNum">    4200 </span>            :        *  @param __s  String to swap with.
<span class="lineNum">    4201 </span>            :        *
<span class="lineNum">    4202 </span>            :        *  Exchanges the contents of this string with that of @a __s in constant
<span class="lineNum">    4203 </span>            :        *  time.
<span class="lineNum">    4204 </span>            :       */
<span class="lineNum">    4205 </span>            :       // PR 58265, this should be noexcept.
<span class="lineNum">    4206 </span>            :       void
<span class="lineNum">    4207 </span>            :       swap(basic_string&amp; __s);
<span class="lineNum">    4208 </span>            : 
<span class="lineNum">    4209 </span>            :       // String operations:
<span class="lineNum">    4210 </span>            :       /**
<span class="lineNum">    4211 </span>            :        *  @brief  Return const pointer to null-terminated contents.
<span class="lineNum">    4212 </span>            :        *
<span class="lineNum">    4213 </span>            :        *  This is a handle to internal data.  Do not modify or dire things may
<span class="lineNum">    4214 </span>            :        *  happen.
<span class="lineNum">    4215 </span>            :       */
<span class="lineNum">    4216 </span>            :       const _CharT*
<span class="lineNum">    4217 </span>            :       c_str() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    4218 </span>            :       { return _M_data(); }
<span class="lineNum">    4219 </span>            : 
<span class="lineNum">    4220 </span>            :       /**
<span class="lineNum">    4221 </span>            :        *  @brief  Return const pointer to contents.
<span class="lineNum">    4222 </span>            :        *
<span class="lineNum">    4223 </span>            :        *  This is a handle to internal data.  Do not modify or dire things may
<span class="lineNum">    4224 </span>            :        *  happen.
<span class="lineNum">    4225 </span>            :       */
<span class="lineNum">    4226 </span>            :       const _CharT*
<span class="lineNum">    4227 </span>            :       data() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    4228 </span>            :       { return _M_data(); }
<span class="lineNum">    4229 </span>            : 
<span class="lineNum">    4230 </span>            :       /**
<span class="lineNum">    4231 </span>            :        *  @brief  Return copy of allocator used to construct this string.
<span class="lineNum">    4232 </span>            :       */
<span class="lineNum">    4233 </span>            :       allocator_type
<span class="lineNum">    4234 </span>            :       get_allocator() const _GLIBCXX_NOEXCEPT
<span class="lineNum">    4235 </span>            :       { return _M_dataplus; }
<span class="lineNum">    4236 </span>            : 
<span class="lineNum">    4237 </span>            :       /**
<span class="lineNum">    4238 </span>            :        *  @brief  Find position of a C substring.
<span class="lineNum">    4239 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    4240 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    4241 </span>            :        *  @param __n  Number of characters from @a s to search for.
<span class="lineNum">    4242 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    4243 </span>            :        *
<span class="lineNum">    4244 </span>            :        *  Starting from @a __pos, searches forward for the first @a
<span class="lineNum">    4245 </span>            :        *  __n characters in @a __s within this string.  If found,
<span class="lineNum">    4246 </span>            :        *  returns the index where it begins.  If not found, returns
<span class="lineNum">    4247 </span>            :        *  npos.
<span class="lineNum">    4248 </span>            :       */
<span class="lineNum">    4249 </span>            :       size_type
<span class="lineNum">    4250 </span>            :       find(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    4251 </span>            : 
<span class="lineNum">    4252 </span>            :       /**
<span class="lineNum">    4253 </span>            :        *  @brief  Find position of a string.
<span class="lineNum">    4254 </span>            :        *  @param __str  String to locate.
<span class="lineNum">    4255 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4256 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    4257 </span>            :        *
<span class="lineNum">    4258 </span>            :        *  Starting from @a __pos, searches forward for value of @a __str within
<span class="lineNum">    4259 </span>            :        *  this string.  If found, returns the index where it begins.  If not
<span class="lineNum">    4260 </span>            :        *  found, returns npos.
<span class="lineNum">    4261 </span>            :       */
<span class="lineNum">    4262 </span>            :       size_type
<span class="lineNum">    4263 </span>            :       find(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    4264 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4265 </span>            :       { return this-&gt;find(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4266 </span>            : 
<span class="lineNum">    4267 </span>            :       /**
<span class="lineNum">    4268 </span>            :        *  @brief  Find position of a C string.
<span class="lineNum">    4269 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    4270 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4271 </span>            :        *  @return  Index of start of first occurrence.
<span class="lineNum">    4272 </span>            :        *
<span class="lineNum">    4273 </span>            :        *  Starting from @a __pos, searches forward for the value of @a
<span class="lineNum">    4274 </span>            :        *  __s within this string.  If found, returns the index where
<span class="lineNum">    4275 </span>            :        *  it begins.  If not found, returns npos.
<span class="lineNum">    4276 </span>            :       */
<span class="lineNum">    4277 </span>            :       size_type
<span class="lineNum">    4278 </span>            :       find(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    4279 </span>            :       {
<span class="lineNum">    4280 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4281 </span>            :         return this-&gt;find(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4282 </span>            :       }
<span class="lineNum">    4283 </span>            : 
<span class="lineNum">    4284 </span>            :       /**
<span class="lineNum">    4285 </span>            :        *  @brief  Find position of a character.
<span class="lineNum">    4286 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    4287 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4288 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4289 </span>            :        *
<span class="lineNum">    4290 </span>            :        *  Starting from @a __pos, searches forward for @a __c within
<span class="lineNum">    4291 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    4292 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    4293 </span>            :       */
<span class="lineNum">    4294 </span>            :       size_type
<span class="lineNum">    4295 </span>            :       find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
<span class="lineNum">    4296 </span>            : 
<span class="lineNum">    4297 </span>            :       /**
<span class="lineNum">    4298 </span>            :        *  @brief  Find last position of a string.
<span class="lineNum">    4299 </span>            :        *  @param __str  String to locate.
<span class="lineNum">    4300 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4301 </span>            :        *  @return  Index of start of last occurrence.
<span class="lineNum">    4302 </span>            :        *
<span class="lineNum">    4303 </span>            :        *  Starting from @a __pos, searches backward for value of @a
<span class="lineNum">    4304 </span>            :        *  __str within this string.  If found, returns the index where
<span class="lineNum">    4305 </span>            :        *  it begins.  If not found, returns npos.
<span class="lineNum">    4306 </span>            :       */
<span class="lineNum">    4307 </span>            :       size_type
<span class="lineNum">    4308 </span>            :       rfind(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    4309 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4310 </span>            :       { return this-&gt;rfind(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4311 </span>            : 
<span class="lineNum">    4312 </span>            :       /**
<span class="lineNum">    4313 </span>            :        *  @brief  Find last position of a C substring.
<span class="lineNum">    4314 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    4315 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    4316 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    4317 </span>            :        *  @return  Index of start of last occurrence.
<span class="lineNum">    4318 </span>            :        *
<span class="lineNum">    4319 </span>            :        *  Starting from @a __pos, searches backward for the first @a
<span class="lineNum">    4320 </span>            :        *  __n characters in @a __s within this string.  If found,
<span class="lineNum">    4321 </span>            :        *  returns the index where it begins.  If not found, returns
<span class="lineNum">    4322 </span>            :        *  npos.
<span class="lineNum">    4323 </span>            :       */
<span class="lineNum">    4324 </span>            :       size_type
<span class="lineNum">    4325 </span>            :       rfind(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    4326 </span>            : 
<span class="lineNum">    4327 </span>            :       /**
<span class="lineNum">    4328 </span>            :        *  @brief  Find last position of a C string.
<span class="lineNum">    4329 </span>            :        *  @param __s  C string to locate.
<span class="lineNum">    4330 </span>            :        *  @param __pos  Index of character to start search at (default end).
<span class="lineNum">    4331 </span>            :        *  @return  Index of start of  last occurrence.
<span class="lineNum">    4332 </span>            :        *
<span class="lineNum">    4333 </span>            :        *  Starting from @a __pos, searches backward for the value of
<span class="lineNum">    4334 </span>            :        *  @a __s within this string.  If found, returns the index
<span class="lineNum">    4335 </span>            :        *  where it begins.  If not found, returns npos.
<span class="lineNum">    4336 </span>            :       */
<span class="lineNum">    4337 </span>            :       size_type
<span class="lineNum">    4338 </span>            :       rfind(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    4339 </span>            :       {
<span class="lineNum">    4340 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4341 </span>            :         return this-&gt;rfind(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4342 </span>            :       }
<span class="lineNum">    4343 </span>            : 
<span class="lineNum">    4344 </span>            :       /**
<span class="lineNum">    4345 </span>            :        *  @brief  Find last position of a character.
<span class="lineNum">    4346 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    4347 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4348 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4349 </span>            :        *
<span class="lineNum">    4350 </span>            :        *  Starting from @a __pos, searches backward for @a __c within
<span class="lineNum">    4351 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    4352 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    4353 </span>            :       */
<span class="lineNum">    4354 </span>            :       size_type
<span class="lineNum">    4355 </span>            :       rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
<span class="lineNum">    4356 </span>            : 
<span class="lineNum">    4357 </span>            :       /**
<span class="lineNum">    4358 </span>            :        *  @brief  Find position of a character of string.
<span class="lineNum">    4359 </span>            :        *  @param __str  String containing characters to locate.
<span class="lineNum">    4360 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4361 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4362 </span>            :        *
<span class="lineNum">    4363 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    4364 </span>            :        *  characters of @a __str within this string.  If found,
<span class="lineNum">    4365 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    4366 </span>            :        *  npos.
<span class="lineNum">    4367 </span>            :       */
<span class="lineNum">    4368 </span>            :       size_type
<span class="lineNum">    4369 </span>            :       find_first_of(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    4370 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4371 </span>            :       { return this-&gt;find_first_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4372 </span>            : 
<span class="lineNum">    4373 </span>            :       /**
<span class="lineNum">    4374 </span>            :        *  @brief  Find position of a character of C substring.
<span class="lineNum">    4375 </span>            :        *  @param __s  String containing characters to locate.
<span class="lineNum">    4376 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    4377 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    4378 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4379 </span>            :        *
<span class="lineNum">    4380 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    4381 </span>            :        *  first @a __n characters of @a __s within this string.  If
<span class="lineNum">    4382 </span>            :        *  found, returns the index where it was found.  If not found,
<span class="lineNum">    4383 </span>            :        *  returns npos.
<span class="lineNum">    4384 </span>            :       */
<span class="lineNum">    4385 </span>            :       size_type
<span class="lineNum">    4386 </span>            :       find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    4387 </span>            : 
<span class="lineNum">    4388 </span>            :       /**
<span class="lineNum">    4389 </span>            :        *  @brief  Find position of a character of C string.
<span class="lineNum">    4390 </span>            :        *  @param __s  String containing characters to locate.
<span class="lineNum">    4391 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4392 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4393 </span>            :        *
<span class="lineNum">    4394 </span>            :        *  Starting from @a __pos, searches forward for one of the
<span class="lineNum">    4395 </span>            :        *  characters of @a __s within this string.  If found, returns
<span class="lineNum">    4396 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    4397 </span>            :       */
<span class="lineNum">    4398 </span>            :       size_type
<span class="lineNum">    4399 </span>            :       find_first_of(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    4400 </span>            :       {
<span class="lineNum">    4401 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4402 </span>            :         return this-&gt;find_first_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4403 </span>            :       }
<span class="lineNum">    4404 </span>            : 
<span class="lineNum">    4405 </span>            :       /**
<span class="lineNum">    4406 </span>            :        *  @brief  Find position of a character.
<span class="lineNum">    4407 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    4408 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4409 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4410 </span>            :        *
<span class="lineNum">    4411 </span>            :        *  Starting from @a __pos, searches forward for the character
<span class="lineNum">    4412 </span>            :        *  @a __c within this string.  If found, returns the index
<span class="lineNum">    4413 </span>            :        *  where it was found.  If not found, returns npos.
<span class="lineNum">    4414 </span>            :        *
<span class="lineNum">    4415 </span>            :        *  Note: equivalent to find(__c, __pos).
<span class="lineNum">    4416 </span>            :       */
<span class="lineNum">    4417 </span>            :       size_type
<span class="lineNum">    4418 </span>            :       find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    4419 </span>            :       { return this-&gt;find(__c, __pos); }
<span class="lineNum">    4420 </span>            : 
<span class="lineNum">    4421 </span>            :       /**
<span class="lineNum">    4422 </span>            :        *  @brief  Find last position of a character of string.
<span class="lineNum">    4423 </span>            :        *  @param __str  String containing characters to locate.
<span class="lineNum">    4424 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4425 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4426 </span>            :        *
<span class="lineNum">    4427 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    4428 </span>            :        *  characters of @a __str within this string.  If found,
<span class="lineNum">    4429 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    4430 </span>            :        *  npos.
<span class="lineNum">    4431 </span>            :       */
<span class="lineNum">    4432 </span>            :       size_type
<span class="lineNum">    4433 </span>            :       find_last_of(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    4434 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4435 </span>            :       { return this-&gt;find_last_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4436 </span>            : 
<span class="lineNum">    4437 </span>            :       /**
<span class="lineNum">    4438 </span>            :        *  @brief  Find last position of a character of C substring.
<span class="lineNum">    4439 </span>            :        *  @param __s  C string containing characters to locate.
<span class="lineNum">    4440 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    4441 </span>            :        *  @param __n  Number of characters from s to search for.
<span class="lineNum">    4442 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4443 </span>            :        *
<span class="lineNum">    4444 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    4445 </span>            :        *  first @a __n characters of @a __s within this string.  If
<span class="lineNum">    4446 </span>            :        *  found, returns the index where it was found.  If not found,
<span class="lineNum">    4447 </span>            :        *  returns npos.
<span class="lineNum">    4448 </span>            :       */
<span class="lineNum">    4449 </span>            :       size_type
<span class="lineNum">    4450 </span>            :       find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
<span class="lineNum">    4451 </span>            : 
<span class="lineNum">    4452 </span>            :       /**
<span class="lineNum">    4453 </span>            :        *  @brief  Find last position of a character of C string.
<span class="lineNum">    4454 </span>            :        *  @param __s  C string containing characters to locate.
<span class="lineNum">    4455 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4456 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4457 </span>            :        *
<span class="lineNum">    4458 </span>            :        *  Starting from @a __pos, searches backward for one of the
<span class="lineNum">    4459 </span>            :        *  characters of @a __s within this string.  If found, returns
<span class="lineNum">    4460 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    4461 </span>            :       */
<span class="lineNum">    4462 </span>            :       size_type
<span class="lineNum">    4463 </span>            :       find_last_of(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    4464 </span>            :       {
<span class="lineNum">    4465 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4466 </span>            :         return this-&gt;find_last_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4467 </span>            :       }
<span class="lineNum">    4468 </span>            : 
<span class="lineNum">    4469 </span>            :       /**
<span class="lineNum">    4470 </span>            :        *  @brief  Find last position of a character.
<span class="lineNum">    4471 </span>            :        *  @param __c  Character to locate.
<span class="lineNum">    4472 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4473 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4474 </span>            :        *
<span class="lineNum">    4475 </span>            :        *  Starting from @a __pos, searches backward for @a __c within
<span class="lineNum">    4476 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    4477 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    4478 </span>            :        *
<span class="lineNum">    4479 </span>            :        *  Note: equivalent to rfind(__c, __pos).
<span class="lineNum">    4480 </span>            :       */
<span class="lineNum">    4481 </span>            :       size_type
<span class="lineNum">    4482 </span>            :       find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
<span class="lineNum">    4483 </span>            :       { return this-&gt;rfind(__c, __pos); }
<span class="lineNum">    4484 </span>            : 
<span class="lineNum">    4485 </span>            :       /**
<span class="lineNum">    4486 </span>            :        *  @brief  Find position of a character not in string.
<span class="lineNum">    4487 </span>            :        *  @param __str  String containing characters to avoid.
<span class="lineNum">    4488 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4489 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4490 </span>            :        *
<span class="lineNum">    4491 </span>            :        *  Starting from @a __pos, searches forward for a character not contained
<span class="lineNum">    4492 </span>            :        *  in @a __str within this string.  If found, returns the index where it
<span class="lineNum">    4493 </span>            :        *  was found.  If not found, returns npos.
<span class="lineNum">    4494 </span>            :       */
<span class="lineNum">    4495 </span>            :       size_type
<span class="lineNum">    4496 </span>            :       find_first_not_of(const basic_string&amp; __str, size_type __pos = 0) const
<span class="lineNum">    4497 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4498 </span>            :       { return this-&gt;find_first_not_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4499 </span>            : 
<span class="lineNum">    4500 </span>            :       /**
<span class="lineNum">    4501 </span>            :        *  @brief  Find position of a character not in C substring.
<span class="lineNum">    4502 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    4503 </span>            :        *  @param __pos  Index of character to search from.
<span class="lineNum">    4504 </span>            :        *  @param __n  Number of characters from __s to consider.
<span class="lineNum">    4505 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4506 </span>            :        *
<span class="lineNum">    4507 </span>            :        *  Starting from @a __pos, searches forward for a character not
<span class="lineNum">    4508 </span>            :        *  contained in the first @a __n characters of @a __s within
<span class="lineNum">    4509 </span>            :        *  this string.  If found, returns the index where it was
<span class="lineNum">    4510 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    4511 </span>            :       */
<span class="lineNum">    4512 </span>            :       size_type
<span class="lineNum">    4513 </span>            :       find_first_not_of(const _CharT* __s, size_type __pos,
<span class="lineNum">    4514 </span>            :                         size_type __n) const;
<span class="lineNum">    4515 </span>            : 
<span class="lineNum">    4516 </span>            :       /**
<span class="lineNum">    4517 </span>            :        *  @brief  Find position of a character not in C string.
<span class="lineNum">    4518 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    4519 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4520 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4521 </span>            :        *
<span class="lineNum">    4522 </span>            :        *  Starting from @a __pos, searches forward for a character not
<span class="lineNum">    4523 </span>            :        *  contained in @a __s within this string.  If found, returns
<span class="lineNum">    4524 </span>            :        *  the index where it was found.  If not found, returns npos.
<span class="lineNum">    4525 </span>            :       */
<span class="lineNum">    4526 </span>            :       size_type
<span class="lineNum">    4527 </span>            :       find_first_not_of(const _CharT* __s, size_type __pos = 0) const
<span class="lineNum">    4528 </span>            :       {
<span class="lineNum">    4529 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4530 </span>            :         return this-&gt;find_first_not_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4531 </span>            :       }
<span class="lineNum">    4532 </span>            : 
<span class="lineNum">    4533 </span>            :       /**
<span class="lineNum">    4534 </span>            :        *  @brief  Find position of a different character.
<span class="lineNum">    4535 </span>            :        *  @param __c  Character to avoid.
<span class="lineNum">    4536 </span>            :        *  @param __pos  Index of character to search from (default 0).
<span class="lineNum">    4537 </span>            :        *  @return  Index of first occurrence.
<span class="lineNum">    4538 </span>            :        *
<span class="lineNum">    4539 </span>            :        *  Starting from @a __pos, searches forward for a character
<span class="lineNum">    4540 </span>            :        *  other than @a __c within this string.  If found, returns the
<span class="lineNum">    4541 </span>            :        *  index where it was found.  If not found, returns npos.
<span class="lineNum">    4542 </span>            :       */
<span class="lineNum">    4543 </span>            :       size_type
<span class="lineNum">    4544 </span>            :       find_first_not_of(_CharT __c, size_type __pos = 0) const
<span class="lineNum">    4545 </span>            :         _GLIBCXX_NOEXCEPT;
<span class="lineNum">    4546 </span>            : 
<span class="lineNum">    4547 </span>            :       /**
<span class="lineNum">    4548 </span>            :        *  @brief  Find last position of a character not in string.
<span class="lineNum">    4549 </span>            :        *  @param __str  String containing characters to avoid.
<span class="lineNum">    4550 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4551 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4552 </span>            :        *
<span class="lineNum">    4553 </span>            :        *  Starting from @a __pos, searches backward for a character
<span class="lineNum">    4554 </span>            :        *  not contained in @a __str within this string.  If found,
<span class="lineNum">    4555 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    4556 </span>            :        *  npos.
<span class="lineNum">    4557 </span>            :       */
<span class="lineNum">    4558 </span>            :       size_type
<span class="lineNum">    4559 </span>            :       find_last_not_of(const basic_string&amp; __str, size_type __pos = npos) const
<span class="lineNum">    4560 </span>            :         _GLIBCXX_NOEXCEPT
<span class="lineNum">    4561 </span>            :       { return this-&gt;find_last_not_of(__str.data(), __pos, __str.size()); }
<span class="lineNum">    4562 </span>            : 
<span class="lineNum">    4563 </span>            :       /**
<span class="lineNum">    4564 </span>            :        *  @brief  Find last position of a character not in C substring.
<span class="lineNum">    4565 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    4566 </span>            :        *  @param __pos  Index of character to search back from.
<span class="lineNum">    4567 </span>            :        *  @param __n  Number of characters from s to consider.
<span class="lineNum">    4568 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4569 </span>            :        *
<span class="lineNum">    4570 </span>            :        *  Starting from @a __pos, searches backward for a character not
<span class="lineNum">    4571 </span>            :        *  contained in the first @a __n characters of @a __s within this string.
<span class="lineNum">    4572 </span>            :        *  If found, returns the index where it was found.  If not found,
<span class="lineNum">    4573 </span>            :        *  returns npos.
<span class="lineNum">    4574 </span>            :       */
<span class="lineNum">    4575 </span>            :       size_type
<span class="lineNum">    4576 </span>            :       find_last_not_of(const _CharT* __s, size_type __pos,
<span class="lineNum">    4577 </span>            :                        size_type __n) const;
<span class="lineNum">    4578 </span>            :       /**
<span class="lineNum">    4579 </span>            :        *  @brief  Find last position of a character not in C string.
<span class="lineNum">    4580 </span>            :        *  @param __s  C string containing characters to avoid.
<span class="lineNum">    4581 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4582 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4583 </span>            :        *
<span class="lineNum">    4584 </span>            :        *  Starting from @a __pos, searches backward for a character
<span class="lineNum">    4585 </span>            :        *  not contained in @a __s within this string.  If found,
<span class="lineNum">    4586 </span>            :        *  returns the index where it was found.  If not found, returns
<span class="lineNum">    4587 </span>            :        *  npos.
<span class="lineNum">    4588 </span>            :       */
<span class="lineNum">    4589 </span>            :       size_type
<span class="lineNum">    4590 </span>            :       find_last_not_of(const _CharT* __s, size_type __pos = npos) const
<span class="lineNum">    4591 </span>            :       {
<span class="lineNum">    4592 </span>            :         __glibcxx_requires_string(__s);
<span class="lineNum">    4593 </span>            :         return this-&gt;find_last_not_of(__s, __pos, traits_type::length(__s));
<span class="lineNum">    4594 </span>            :       }
<span class="lineNum">    4595 </span>            : 
<span class="lineNum">    4596 </span>            :       /**
<span class="lineNum">    4597 </span>            :        *  @brief  Find last position of a different character.
<span class="lineNum">    4598 </span>            :        *  @param __c  Character to avoid.
<span class="lineNum">    4599 </span>            :        *  @param __pos  Index of character to search back from (default end).
<span class="lineNum">    4600 </span>            :        *  @return  Index of last occurrence.
<span class="lineNum">    4601 </span>            :        *
<span class="lineNum">    4602 </span>            :        *  Starting from @a __pos, searches backward for a character other than
<span class="lineNum">    4603 </span>            :        *  @a __c within this string.  If found, returns the index where it was
<span class="lineNum">    4604 </span>            :        *  found.  If not found, returns npos.
<span class="lineNum">    4605 </span>            :       */
<span class="lineNum">    4606 </span>            :       size_type
<span class="lineNum">    4607 </span>            :       find_last_not_of(_CharT __c, size_type __pos = npos) const
<span class="lineNum">    4608 </span>            :         _GLIBCXX_NOEXCEPT;
<span class="lineNum">    4609 </span>            : 
<span class="lineNum">    4610 </span>            :       /**
<span class="lineNum">    4611 </span>            :        *  @brief  Get a substring.
<span class="lineNum">    4612 </span>            :        *  @param __pos  Index of first character (default 0).
<span class="lineNum">    4613 </span>            :        *  @param __n  Number of characters in substring (default remainder).
<span class="lineNum">    4614 </span>            :        *  @return  The new string.
<span class="lineNum">    4615 </span>            :        *  @throw  std::out_of_range  If __pos &gt; size().
<span class="lineNum">    4616 </span>            :        *
<span class="lineNum">    4617 </span>            :        *  Construct and return a new string using the @a __n
<span class="lineNum">    4618 </span>            :        *  characters starting at @a __pos.  If the string is too
<span class="lineNum">    4619 </span>            :        *  short, use the remainder of the characters.  If @a __pos is
<span class="lineNum">    4620 </span>            :        *  beyond the end of the string, out_of_range is thrown.
<span class="lineNum">    4621 </span>            :       */
<span class="lineNum">    4622 </span>            :       basic_string
<span class="lineNum">    4623 </span>            :       substr(size_type __pos = 0, size_type __n = npos) const
<span class="lineNum">    4624 </span>            :       { return basic_string(*this,
<span class="lineNum">    4625 </span>            :                             _M_check(__pos, &quot;basic_string::substr&quot;), __n); }
<span class="lineNum">    4626 </span>            : 
<span class="lineNum">    4627 </span>            :       /**
<span class="lineNum">    4628 </span>            :        *  @brief  Compare to a string.
<span class="lineNum">    4629 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    4630 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4631 </span>            :        *
<span class="lineNum">    4632 </span>            :        *  Returns an integer &lt; 0 if this string is ordered before @a
<span class="lineNum">    4633 </span>            :        *  __str, 0 if their values are equivalent, or &gt; 0 if this
<span class="lineNum">    4634 </span>            :        *  string is ordered after @a __str.  Determines the effective
<span class="lineNum">    4635 </span>            :        *  length rlen of the strings to compare as the smallest of
<span class="lineNum">    4636 </span>            :        *  size() and str.size().  The function then compares the two
<span class="lineNum">    4637 </span>            :        *  strings by calling traits::compare(data(), str.data(),rlen).
<span class="lineNum">    4638 </span>            :        *  If the result of the comparison is nonzero returns it,
<span class="lineNum">    4639 </span>            :        *  otherwise the shorter one is ordered first.
<span class="lineNum">    4640 </span>            :       */
<span class="lineNum">    4641 </span>            :       int
<span class="lineNum">    4642 </span>            :       compare(const basic_string&amp; __str) const
<span class="lineNum">    4643 </span>            :       {
<span class="lineNum">    4644 </span>            :         const size_type __size = this-&gt;size();
<span class="lineNum">    4645 </span>            :         const size_type __osize = __str.size();
<span class="lineNum">    4646 </span>            :         const size_type __len = std::min(__size, __osize);
<span class="lineNum">    4647 </span>            : 
<span class="lineNum">    4648 </span>            :         int __r = traits_type::compare(_M_data(), __str.data(), __len);
<span class="lineNum">    4649 </span>            :         if (!__r)
<span class="lineNum">    4650 </span>            :           __r = _S_compare(__size, __osize);
<span class="lineNum">    4651 </span>            :         return __r;
<span class="lineNum">    4652 </span>            :       }
<span class="lineNum">    4653 </span>            : 
<span class="lineNum">    4654 </span>            :       /**
<span class="lineNum">    4655 </span>            :        *  @brief  Compare substring to a string.
<span class="lineNum">    4656 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    4657 </span>            :        *  @param __n  Number of characters in substring.
<span class="lineNum">    4658 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    4659 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4660 </span>            :        *
<span class="lineNum">    4661 </span>            :        *  Form the substring of this string from the @a __n characters
<span class="lineNum">    4662 </span>            :        *  starting at @a __pos.  Returns an integer &lt; 0 if the
<span class="lineNum">    4663 </span>            :        *  substring is ordered before @a __str, 0 if their values are
<span class="lineNum">    4664 </span>            :        *  equivalent, or &gt; 0 if the substring is ordered after @a
<span class="lineNum">    4665 </span>            :        *  __str.  Determines the effective length rlen of the strings
<span class="lineNum">    4666 </span>            :        *  to compare as the smallest of the length of the substring
<span class="lineNum">    4667 </span>            :        *  and @a __str.size().  The function then compares the two
<span class="lineNum">    4668 </span>            :        *  strings by calling
<span class="lineNum">    4669 </span>            :        *  traits::compare(substring.data(),str.data(),rlen).  If the
<span class="lineNum">    4670 </span>            :        *  result of the comparison is nonzero returns it, otherwise
<span class="lineNum">    4671 </span>            :        *  the shorter one is ordered first.
<span class="lineNum">    4672 </span>            :       */
<span class="lineNum">    4673 </span>            :       int
<span class="lineNum">    4674 </span>            :       compare(size_type __pos, size_type __n, const basic_string&amp; __str) const;
<span class="lineNum">    4675 </span>            : 
<span class="lineNum">    4676 </span>            :       /**
<span class="lineNum">    4677 </span>            :        *  @brief  Compare substring to a substring.
<span class="lineNum">    4678 </span>            :        *  @param __pos1  Index of first character of substring.
<span class="lineNum">    4679 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    4680 </span>            :        *  @param __str  String to compare against.
<span class="lineNum">    4681 </span>            :        *  @param __pos2  Index of first character of substring of str.
<span class="lineNum">    4682 </span>            :        *  @param __n2  Number of characters in substring of str.
<span class="lineNum">    4683 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4684 </span>            :        *
<span class="lineNum">    4685 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    4686 </span>            :        *  characters starting at @a __pos1.  Form the substring of @a
<span class="lineNum">    4687 </span>            :        *  __str from the @a __n2 characters starting at @a __pos2.
<span class="lineNum">    4688 </span>            :        *  Returns an integer &lt; 0 if this substring is ordered before
<span class="lineNum">    4689 </span>            :        *  the substring of @a __str, 0 if their values are equivalent,
<span class="lineNum">    4690 </span>            :        *  or &gt; 0 if this substring is ordered after the substring of
<span class="lineNum">    4691 </span>            :        *  @a __str.  Determines the effective length rlen of the
<span class="lineNum">    4692 </span>            :        *  strings to compare as the smallest of the lengths of the
<span class="lineNum">    4693 </span>            :        *  substrings.  The function then compares the two strings by
<span class="lineNum">    4694 </span>            :        *  calling
<span class="lineNum">    4695 </span>            :        *  traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
<span class="lineNum">    4696 </span>            :        *  If the result of the comparison is nonzero returns it,
<span class="lineNum">    4697 </span>            :        *  otherwise the shorter one is ordered first.
<span class="lineNum">    4698 </span>            :       */
<span class="lineNum">    4699 </span>            :       int
<span class="lineNum">    4700 </span>            :       compare(size_type __pos1, size_type __n1, const basic_string&amp; __str,
<span class="lineNum">    4701 </span>            :               size_type __pos2, size_type __n2) const;
<span class="lineNum">    4702 </span>            : 
<span class="lineNum">    4703 </span>            :       /**
<span class="lineNum">    4704 </span>            :        *  @brief  Compare to a C string.
<span class="lineNum">    4705 </span>            :        *  @param __s  C string to compare against.
<span class="lineNum">    4706 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4707 </span>            :        *
<span class="lineNum">    4708 </span>            :        *  Returns an integer &lt; 0 if this string is ordered before @a __s, 0 if
<span class="lineNum">    4709 </span>            :        *  their values are equivalent, or &gt; 0 if this string is ordered after
<span class="lineNum">    4710 </span>            :        *  @a __s.  Determines the effective length rlen of the strings to
<span class="lineNum">    4711 </span>            :        *  compare as the smallest of size() and the length of a string
<span class="lineNum">    4712 </span>            :        *  constructed from @a __s.  The function then compares the two strings
<span class="lineNum">    4713 </span>            :        *  by calling traits::compare(data(),s,rlen).  If the result of the
<span class="lineNum">    4714 </span>            :        *  comparison is nonzero returns it, otherwise the shorter one is
<span class="lineNum">    4715 </span>            :        *  ordered first.
<span class="lineNum">    4716 </span>            :       */
<span class="lineNum">    4717 </span>            :       int
<span class="lineNum">    4718 </span>            :       compare(const _CharT* __s) const;
<span class="lineNum">    4719 </span>            : 
<span class="lineNum">    4720 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    4721 </span>            :       // 5 String::compare specification questionable
<span class="lineNum">    4722 </span>            :       /**
<span class="lineNum">    4723 </span>            :        *  @brief  Compare substring to a C string.
<span class="lineNum">    4724 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    4725 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    4726 </span>            :        *  @param __s  C string to compare against.
<span class="lineNum">    4727 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4728 </span>            :        *
<span class="lineNum">    4729 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    4730 </span>            :        *  characters starting at @a pos.  Returns an integer &lt; 0 if
<span class="lineNum">    4731 </span>            :        *  the substring is ordered before @a __s, 0 if their values
<span class="lineNum">    4732 </span>            :        *  are equivalent, or &gt; 0 if the substring is ordered after @a
<span class="lineNum">    4733 </span>            :        *  __s.  Determines the effective length rlen of the strings to
<span class="lineNum">    4734 </span>            :        *  compare as the smallest of the length of the substring and
<span class="lineNum">    4735 </span>            :        *  the length of a string constructed from @a __s.  The
<span class="lineNum">    4736 </span>            :        *  function then compares the two string by calling
<span class="lineNum">    4737 </span>            :        *  traits::compare(substring.data(),__s,rlen).  If the result of
<span class="lineNum">    4738 </span>            :        *  the comparison is nonzero returns it, otherwise the shorter
<span class="lineNum">    4739 </span>            :        *  one is ordered first.
<span class="lineNum">    4740 </span>            :       */
<span class="lineNum">    4741 </span>            :       int
<span class="lineNum">    4742 </span>            :       compare(size_type __pos, size_type __n1, const _CharT* __s) const;
<span class="lineNum">    4743 </span>            : 
<span class="lineNum">    4744 </span>            :       /**
<span class="lineNum">    4745 </span>            :        *  @brief  Compare substring against a character %array.
<span class="lineNum">    4746 </span>            :        *  @param __pos  Index of first character of substring.
<span class="lineNum">    4747 </span>            :        *  @param __n1  Number of characters in substring.
<span class="lineNum">    4748 </span>            :        *  @param __s  character %array to compare against.
<span class="lineNum">    4749 </span>            :        *  @param __n2  Number of characters of s.
<span class="lineNum">    4750 </span>            :        *  @return  Integer &lt; 0, 0, or &gt; 0.
<span class="lineNum">    4751 </span>            :        *
<span class="lineNum">    4752 </span>            :        *  Form the substring of this string from the @a __n1
<span class="lineNum">    4753 </span>            :        *  characters starting at @a __pos.  Form a string from the
<span class="lineNum">    4754 </span>            :        *  first @a __n2 characters of @a __s.  Returns an integer &lt; 0
<span class="lineNum">    4755 </span>            :        *  if this substring is ordered before the string from @a __s,
<span class="lineNum">    4756 </span>            :        *  0 if their values are equivalent, or &gt; 0 if this substring
<span class="lineNum">    4757 </span>            :        *  is ordered after the string from @a __s.  Determines the
<span class="lineNum">    4758 </span>            :        *  effective length rlen of the strings to compare as the
<span class="lineNum">    4759 </span>            :        *  smallest of the length of the substring and @a __n2.  The
<span class="lineNum">    4760 </span>            :        *  function then compares the two strings by calling
<span class="lineNum">    4761 </span>            :        *  traits::compare(substring.data(),s,rlen).  If the result of
<span class="lineNum">    4762 </span>            :        *  the comparison is nonzero returns it, otherwise the shorter
<span class="lineNum">    4763 </span>            :        *  one is ordered first.
<span class="lineNum">    4764 </span>            :        *
<span class="lineNum">    4765 </span>            :        *  NB: s must have at least n2 characters, &amp;apos;\\0&amp;apos; has
<span class="lineNum">    4766 </span>            :        *  no special meaning.
<span class="lineNum">    4767 </span>            :       */
<span class="lineNum">    4768 </span>            :       int
<span class="lineNum">    4769 </span>            :       compare(size_type __pos, size_type __n1, const _CharT* __s,
<span class="lineNum">    4770 </span>            :               size_type __n2) const;
<span class="lineNum">    4771 </span>            :   };
<span class="lineNum">    4772 </span>            : #endif  // !_GLIBCXX_USE_CXX11_ABI
<span class="lineNum">    4773 </span>            : 
<span class="lineNum">    4774 </span>            :   // operator+
<span class="lineNum">    4775 </span>            :   /**
<span class="lineNum">    4776 </span>            :    *  @brief  Concatenate two strings.
<span class="lineNum">    4777 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4778 </span>            :    *  @param __rhs  Last string.
<span class="lineNum">    4779 </span>            :    *  @return  New string with value of @a __lhs followed by @a __rhs.
<span class="lineNum">    4780 </span>            :    */
<a name="4781"><span class="lineNum">    4781 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;</a>
<span class="lineNum">    4782 </span>            :     basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4783 </span><span class="lineCov">         10 :     operator+(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,</span>
<span class="lineNum">    4784 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4785 </span>            :     {
<span class="lineNum">    4786 </span>            :       basic_string&lt;_CharT, _Traits, _Alloc&gt; __str(__lhs);
<span class="lineNum">    4787 </span>            :       __str.append(__rhs);
<span class="lineNum">    4788 </span><span class="lineCov">         10 :       return __str;</span>
<span class="lineNum">    4789 </span>            :     }
<span class="lineNum">    4790 </span>            : 
<span class="lineNum">    4791 </span>            :   /**
<span class="lineNum">    4792 </span>            :    *  @brief  Concatenate C string and string.
<span class="lineNum">    4793 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4794 </span>            :    *  @param __rhs  Last string.
<span class="lineNum">    4795 </span>            :    *  @return  New string with value of @a __lhs followed by @a __rhs.
<span class="lineNum">    4796 </span>            :    */
<span class="lineNum">    4797 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4798 </span>            :     basic_string&lt;_CharT,_Traits,_Alloc&gt;
<span class="lineNum">    4799 </span>            :     operator+(const _CharT* __lhs,
<span class="lineNum">    4800 </span>            :               const basic_string&lt;_CharT,_Traits,_Alloc&gt;&amp; __rhs);
<span class="lineNum">    4801 </span>            : 
<span class="lineNum">    4802 </span>            :   /**
<span class="lineNum">    4803 </span>            :    *  @brief  Concatenate character and string.
<span class="lineNum">    4804 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4805 </span>            :    *  @param __rhs  Last string.
<span class="lineNum">    4806 </span>            :    *  @return  New string with @a __lhs followed by @a __rhs.
<span class="lineNum">    4807 </span>            :    */
<span class="lineNum">    4808 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4809 </span>            :     basic_string&lt;_CharT,_Traits,_Alloc&gt;
<span class="lineNum">    4810 </span>            :     operator+(_CharT __lhs, const basic_string&lt;_CharT,_Traits,_Alloc&gt;&amp; __rhs);
<span class="lineNum">    4811 </span>            : 
<span class="lineNum">    4812 </span>            :   /**
<span class="lineNum">    4813 </span>            :    *  @brief  Concatenate string and C string.
<span class="lineNum">    4814 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4815 </span>            :    *  @param __rhs  Last string.
<span class="lineNum">    4816 </span>            :    *  @return  New string with @a __lhs followed by @a __rhs.
<span class="lineNum">    4817 </span>            :    */
<a name="4818"><span class="lineNum">    4818 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;</a>
<span class="lineNum">    4819 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4820 </span><span class="lineCov">          5 :     operator+(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,</span>
<span class="lineNum">    4821 </span>            :               const _CharT* __rhs)
<span class="lineNum">    4822 </span>            :     {
<span class="lineNum">    4823 </span>            :       basic_string&lt;_CharT, _Traits, _Alloc&gt; __str(__lhs);
<span class="lineNum">    4824 </span><span class="lineCov">          5 :       __str.append(__rhs);</span>
<span class="lineNum">    4825 </span><span class="lineCov">          5 :       return __str;</span>
<span class="lineNum">    4826 </span>            :     }
<span class="lineNum">    4827 </span>            : 
<span class="lineNum">    4828 </span>            :   /**
<span class="lineNum">    4829 </span>            :    *  @brief  Concatenate string and character.
<span class="lineNum">    4830 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4831 </span>            :    *  @param __rhs  Last string.
<span class="lineNum">    4832 </span>            :    *  @return  New string with @a __lhs followed by @a __rhs.
<span class="lineNum">    4833 </span>            :    */
<span class="lineNum">    4834 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4835 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4836 </span>            :     operator+(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs, _CharT __rhs)
<span class="lineNum">    4837 </span>            :     {
<span class="lineNum">    4838 </span>            :       typedef basic_string&lt;_CharT, _Traits, _Alloc&gt;       __string_type;
<span class="lineNum">    4839 </span>            :       typedef typename __string_type::size_type         __size_type;
<span class="lineNum">    4840 </span>            :       __string_type __str(__lhs);
<span class="lineNum">    4841 </span>            :       __str.append(__size_type(1), __rhs);
<span class="lineNum">    4842 </span>            :       return __str;
<span class="lineNum">    4843 </span>            :     }
<span class="lineNum">    4844 </span>            : 
<span class="lineNum">    4845 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    4846 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4847 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4848 </span>            :     operator+(basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __lhs,
<span class="lineNum">    4849 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4850 </span>            :     { return std::move(__lhs.append(__rhs)); }
<span class="lineNum">    4851 </span>            : 
<span class="lineNum">    4852 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4853 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4854 </span>            :     operator+(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4855 </span>            :               basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __rhs)
<span class="lineNum">    4856 </span>            :     { return std::move(__rhs.insert(0, __lhs)); }
<span class="lineNum">    4857 </span>            : 
<span class="lineNum">    4858 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4859 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4860 </span>            :     operator+(basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __lhs,
<span class="lineNum">    4861 </span>            :               basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __rhs)
<span class="lineNum">    4862 </span>            :     {
<span class="lineNum">    4863 </span>            :       const auto __size = __lhs.size() + __rhs.size();
<span class="lineNum">    4864 </span>            :       const bool __cond = (__size &gt; __lhs.capacity()
<span class="lineNum">    4865 </span>            :                            &amp;&amp; __size &lt;= __rhs.capacity());
<span class="lineNum">    4866 </span>            :       return __cond ? std::move(__rhs.insert(0, __lhs))
<span class="lineNum">    4867 </span>            :                     : std::move(__lhs.append(__rhs));
<span class="lineNum">    4868 </span>            :     }
<span class="lineNum">    4869 </span>            : 
<span class="lineNum">    4870 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4871 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4872 </span>            :     operator+(const _CharT* __lhs,
<span class="lineNum">    4873 </span>            :               basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __rhs)
<span class="lineNum">    4874 </span>            :     { return std::move(__rhs.insert(0, __lhs)); }
<span class="lineNum">    4875 </span>            : 
<span class="lineNum">    4876 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4877 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4878 </span>            :     operator+(_CharT __lhs,
<span class="lineNum">    4879 </span>            :               basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __rhs)
<span class="lineNum">    4880 </span>            :     { return std::move(__rhs.insert(0, 1, __lhs)); }
<span class="lineNum">    4881 </span>            : 
<span class="lineNum">    4882 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4883 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4884 </span>            :     operator+(basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __lhs,
<span class="lineNum">    4885 </span>            :               const _CharT* __rhs)
<span class="lineNum">    4886 </span>            :     { return std::move(__lhs.append(__rhs)); }
<span class="lineNum">    4887 </span>            : 
<span class="lineNum">    4888 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4889 </span>            :     inline basic_string&lt;_CharT, _Traits, _Alloc&gt;
<span class="lineNum">    4890 </span>            :     operator+(basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;&amp; __lhs,
<span class="lineNum">    4891 </span>            :               _CharT __rhs)
<span class="lineNum">    4892 </span>            :     { return std::move(__lhs.append(1, __rhs)); }
<span class="lineNum">    4893 </span>            : #endif
<span class="lineNum">    4894 </span>            : 
<span class="lineNum">    4895 </span>            :   // operator ==
<span class="lineNum">    4896 </span>            :   /**
<span class="lineNum">    4897 </span>            :    *  @brief  Test equivalence of two strings.
<span class="lineNum">    4898 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4899 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    4900 </span>            :    *  @return  True if @a __lhs.compare(@a __rhs) == 0.  False otherwise.
<span class="lineNum">    4901 </span>            :    */
<span class="lineNum">    4902 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4903 </span>            :     inline bool
<span class="lineNum">    4904 </span>            :     operator==(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4905 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4906 </span>            :     { return __lhs.compare(__rhs) == 0; }
<span class="lineNum">    4907 </span>            : 
<span class="lineNum">    4908 </span>            :   template&lt;typename _CharT&gt;
<a name="4909"><span class="lineNum">    4909 </span>            :     inline</a>
<span class="lineNum">    4910 </span>            :     typename __gnu_cxx::__enable_if&lt;__is_char&lt;_CharT&gt;::__value, bool&gt;::__type
<span class="lineNum">    4911 </span><span class="lineCov">       1174 :     operator==(const basic_string&lt;_CharT&gt;&amp; __lhs,</span>
<span class="lineNum">    4912 </span>            :                const basic_string&lt;_CharT&gt;&amp; __rhs)
<span class="lineNum">    4913 </span>            :     { return (__lhs.size() == __rhs.size()
<span class="lineNum">    4914 </span>            :               &amp;&amp; !std::char_traits&lt;_CharT&gt;::compare(__lhs.data(), __rhs.data(),
<span class="lineNum">    4915 </span><span class="lineCov">       1709 :                                                     __lhs.size())); }</span>
<span class="lineNum">    4916 </span>            : 
<span class="lineNum">    4917 </span>            :   /**
<span class="lineNum">    4918 </span>            :    *  @brief  Test equivalence of C string and string.
<span class="lineNum">    4919 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    4920 </span>            :    *  @param __rhs  String.
<span class="lineNum">    4921 </span>            :    *  @return  True if @a __rhs.compare(@a __lhs) == 0.  False otherwise.
<span class="lineNum">    4922 </span>            :    */
<span class="lineNum">    4923 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4924 </span>            :     inline bool
<span class="lineNum">    4925 </span>            :     operator==(const _CharT* __lhs,
<span class="lineNum">    4926 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4927 </span>            :     { return __rhs.compare(__lhs) == 0; }
<span class="lineNum">    4928 </span>            : 
<span class="lineNum">    4929 </span>            :   /**
<span class="lineNum">    4930 </span>            :    *  @brief  Test equivalence of string and C string.
<span class="lineNum">    4931 </span>            :    *  @param __lhs  String.
<span class="lineNum">    4932 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    4933 </span>            :    *  @return  True if @a __lhs.compare(@a __rhs) == 0.  False otherwise.
<span class="lineNum">    4934 </span>            :    */
<span class="lineNum">    4935 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4936 </span>            :     inline bool
<span class="lineNum">    4937 </span>            :     operator==(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4938 </span>            :                const _CharT* __rhs)
<span class="lineNum">    4939 </span><span class="lineCov">     120099 :     { return __lhs.compare(__rhs) == 0; }</span>
<span class="lineNum">    4940 </span>            : 
<span class="lineNum">    4941 </span>            :   // operator !=
<span class="lineNum">    4942 </span>            :   /**
<span class="lineNum">    4943 </span>            :    *  @brief  Test difference of two strings.
<span class="lineNum">    4944 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4945 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    4946 </span>            :    *  @return  True if @a __lhs.compare(@a __rhs) != 0.  False otherwise.
<span class="lineNum">    4947 </span>            :    */
<span class="lineNum">    4948 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4949 </span>            :     inline bool
<span class="lineNum">    4950 </span>            :     operator!=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4951 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4952 </span><span class="lineCov">       1155 :     { return !(__lhs == __rhs); }</span>
<span class="lineNum">    4953 </span>            : 
<span class="lineNum">    4954 </span>            :   /**
<span class="lineNum">    4955 </span>            :    *  @brief  Test difference of C string and string.
<span class="lineNum">    4956 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    4957 </span>            :    *  @param __rhs  String.
<span class="lineNum">    4958 </span>            :    *  @return  True if @a __rhs.compare(@a __lhs) != 0.  False otherwise.
<span class="lineNum">    4959 </span>            :    */
<span class="lineNum">    4960 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4961 </span>            :     inline bool
<span class="lineNum">    4962 </span>            :     operator!=(const _CharT* __lhs,
<span class="lineNum">    4963 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4964 </span>            :     { return !(__lhs == __rhs); }
<span class="lineNum">    4965 </span>            : 
<span class="lineNum">    4966 </span>            :   /**
<span class="lineNum">    4967 </span>            :    *  @brief  Test difference of string and C string.
<span class="lineNum">    4968 </span>            :    *  @param __lhs  String.
<span class="lineNum">    4969 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    4970 </span>            :    *  @return  True if @a __lhs.compare(@a __rhs) != 0.  False otherwise.
<span class="lineNum">    4971 </span>            :    */
<span class="lineNum">    4972 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4973 </span>            :     inline bool
<span class="lineNum">    4974 </span>            :     operator!=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4975 </span>            :                const _CharT* __rhs)
<span class="lineNum">    4976 </span>            :     { return !(__lhs == __rhs); }
<span class="lineNum">    4977 </span>            : 
<span class="lineNum">    4978 </span>            :   // operator &lt;
<span class="lineNum">    4979 </span>            :   /**
<span class="lineNum">    4980 </span>            :    *  @brief  Test if string precedes string.
<span class="lineNum">    4981 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    4982 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    4983 </span>            :    *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
<span class="lineNum">    4984 </span>            :    */
<span class="lineNum">    4985 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4986 </span>            :     inline bool
<span class="lineNum">    4987 </span>            :     operator&lt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    4988 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    4989 </span><span class="lineCov">       3514 :     { return __lhs.compare(__rhs) &lt; 0; }</span>
<span class="lineNum">    4990 </span>            : 
<span class="lineNum">    4991 </span>            :   /**
<span class="lineNum">    4992 </span>            :    *  @brief  Test if string precedes C string.
<span class="lineNum">    4993 </span>            :    *  @param __lhs  String.
<span class="lineNum">    4994 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    4995 </span>            :    *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
<span class="lineNum">    4996 </span>            :    */
<span class="lineNum">    4997 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    4998 </span>            :     inline bool
<span class="lineNum">    4999 </span>            :     operator&lt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5000 </span>            :               const _CharT* __rhs)
<span class="lineNum">    5001 </span>            :     { return __lhs.compare(__rhs) &lt; 0; }
<span class="lineNum">    5002 </span>            : 
<span class="lineNum">    5003 </span>            :   /**
<span class="lineNum">    5004 </span>            :    *  @brief  Test if C string precedes string.
<span class="lineNum">    5005 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    5006 </span>            :    *  @param __rhs  String.
<span class="lineNum">    5007 </span>            :    *  @return  True if @a __lhs precedes @a __rhs.  False otherwise.
<span class="lineNum">    5008 </span>            :    */
<span class="lineNum">    5009 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5010 </span>            :     inline bool
<span class="lineNum">    5011 </span>            :     operator&lt;(const _CharT* __lhs,
<span class="lineNum">    5012 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5013 </span>            :     { return __rhs.compare(__lhs) &gt; 0; }
<span class="lineNum">    5014 </span>            : 
<span class="lineNum">    5015 </span>            :   // operator &gt;
<span class="lineNum">    5016 </span>            :   /**
<span class="lineNum">    5017 </span>            :    *  @brief  Test if string follows string.
<span class="lineNum">    5018 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    5019 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    5020 </span>            :    *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
<span class="lineNum">    5021 </span>            :    */
<span class="lineNum">    5022 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5023 </span>            :     inline bool
<span class="lineNum">    5024 </span>            :     operator&gt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5025 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5026 </span>            :     { return __lhs.compare(__rhs) &gt; 0; }
<span class="lineNum">    5027 </span>            : 
<span class="lineNum">    5028 </span>            :   /**
<span class="lineNum">    5029 </span>            :    *  @brief  Test if string follows C string.
<span class="lineNum">    5030 </span>            :    *  @param __lhs  String.
<span class="lineNum">    5031 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    5032 </span>            :    *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
<span class="lineNum">    5033 </span>            :    */
<span class="lineNum">    5034 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5035 </span>            :     inline bool
<span class="lineNum">    5036 </span>            :     operator&gt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5037 </span>            :               const _CharT* __rhs)
<span class="lineNum">    5038 </span>            :     { return __lhs.compare(__rhs) &gt; 0; }
<span class="lineNum">    5039 </span>            : 
<span class="lineNum">    5040 </span>            :   /**
<span class="lineNum">    5041 </span>            :    *  @brief  Test if C string follows string.
<span class="lineNum">    5042 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    5043 </span>            :    *  @param __rhs  String.
<span class="lineNum">    5044 </span>            :    *  @return  True if @a __lhs follows @a __rhs.  False otherwise.
<span class="lineNum">    5045 </span>            :    */
<span class="lineNum">    5046 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5047 </span>            :     inline bool
<span class="lineNum">    5048 </span>            :     operator&gt;(const _CharT* __lhs,
<span class="lineNum">    5049 </span>            :               const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5050 </span>            :     { return __rhs.compare(__lhs) &lt; 0; }
<span class="lineNum">    5051 </span>            : 
<span class="lineNum">    5052 </span>            :   // operator &lt;=
<span class="lineNum">    5053 </span>            :   /**
<span class="lineNum">    5054 </span>            :    *  @brief  Test if string doesn't follow string.
<span class="lineNum">    5055 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    5056 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    5057 </span>            :    *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
<span class="lineNum">    5058 </span>            :    */
<span class="lineNum">    5059 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5060 </span>            :     inline bool
<span class="lineNum">    5061 </span>            :     operator&lt;=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5062 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5063 </span>            :     { return __lhs.compare(__rhs) &lt;= 0; }
<span class="lineNum">    5064 </span>            : 
<span class="lineNum">    5065 </span>            :   /**
<span class="lineNum">    5066 </span>            :    *  @brief  Test if string doesn't follow C string.
<span class="lineNum">    5067 </span>            :    *  @param __lhs  String.
<span class="lineNum">    5068 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    5069 </span>            :    *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
<span class="lineNum">    5070 </span>            :    */
<span class="lineNum">    5071 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5072 </span>            :     inline bool
<span class="lineNum">    5073 </span>            :     operator&lt;=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5074 </span>            :                const _CharT* __rhs)
<span class="lineNum">    5075 </span>            :     { return __lhs.compare(__rhs) &lt;= 0; }
<span class="lineNum">    5076 </span>            : 
<span class="lineNum">    5077 </span>            :   /**
<span class="lineNum">    5078 </span>            :    *  @brief  Test if C string doesn't follow string.
<span class="lineNum">    5079 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    5080 </span>            :    *  @param __rhs  String.
<span class="lineNum">    5081 </span>            :    *  @return  True if @a __lhs doesn't follow @a __rhs.  False otherwise.
<span class="lineNum">    5082 </span>            :    */
<span class="lineNum">    5083 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5084 </span>            :     inline bool
<span class="lineNum">    5085 </span>            :     operator&lt;=(const _CharT* __lhs,
<span class="lineNum">    5086 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5087 </span>            :     { return __rhs.compare(__lhs) &gt;= 0; }
<span class="lineNum">    5088 </span>            : 
<span class="lineNum">    5089 </span>            :   // operator &gt;=
<span class="lineNum">    5090 </span>            :   /**
<span class="lineNum">    5091 </span>            :    *  @brief  Test if string doesn't precede string.
<span class="lineNum">    5092 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    5093 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    5094 </span>            :    *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
<span class="lineNum">    5095 </span>            :    */
<span class="lineNum">    5096 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5097 </span>            :     inline bool
<span class="lineNum">    5098 </span>            :     operator&gt;=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5099 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5100 </span>            :     { return __lhs.compare(__rhs) &gt;= 0; }
<span class="lineNum">    5101 </span>            : 
<span class="lineNum">    5102 </span>            :   /**
<span class="lineNum">    5103 </span>            :    *  @brief  Test if string doesn't precede C string.
<span class="lineNum">    5104 </span>            :    *  @param __lhs  String.
<span class="lineNum">    5105 </span>            :    *  @param __rhs  C string.
<span class="lineNum">    5106 </span>            :    *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
<span class="lineNum">    5107 </span>            :    */
<span class="lineNum">    5108 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5109 </span>            :     inline bool
<span class="lineNum">    5110 </span>            :     operator&gt;=(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5111 </span>            :                const _CharT* __rhs)
<span class="lineNum">    5112 </span>            :     { return __lhs.compare(__rhs) &gt;= 0; }
<span class="lineNum">    5113 </span>            : 
<span class="lineNum">    5114 </span>            :   /**
<span class="lineNum">    5115 </span>            :    *  @brief  Test if C string doesn't precede string.
<span class="lineNum">    5116 </span>            :    *  @param __lhs  C string.
<span class="lineNum">    5117 </span>            :    *  @param __rhs  String.
<span class="lineNum">    5118 </span>            :    *  @return  True if @a __lhs doesn't precede @a __rhs.  False otherwise.
<span class="lineNum">    5119 </span>            :    */
<span class="lineNum">    5120 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5121 </span>            :     inline bool
<span class="lineNum">    5122 </span>            :     operator&gt;=(const _CharT* __lhs,
<span class="lineNum">    5123 </span>            :              const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5124 </span>            :     { return __rhs.compare(__lhs) &lt;= 0; }
<span class="lineNum">    5125 </span>            : 
<span class="lineNum">    5126 </span>            :   /**
<span class="lineNum">    5127 </span>            :    *  @brief  Swap contents of two strings.
<span class="lineNum">    5128 </span>            :    *  @param __lhs  First string.
<span class="lineNum">    5129 </span>            :    *  @param __rhs  Second string.
<span class="lineNum">    5130 </span>            :    *
<span class="lineNum">    5131 </span>            :    *  Exchanges the contents of @a __lhs and @a __rhs in constant time.
<span class="lineNum">    5132 </span>            :    */
<span class="lineNum">    5133 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5134 </span>            :     inline void
<span class="lineNum">    5135 </span>            :     swap(basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
<span class="lineNum">    5136 </span>            :          basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __rhs)
<span class="lineNum">    5137 </span>            :     { __lhs.swap(__rhs); }
<span class="lineNum">    5138 </span>            : 
<span class="lineNum">    5139 </span>            : 
<span class="lineNum">    5140 </span>            :   /**
<span class="lineNum">    5141 </span>            :    *  @brief  Read stream into a string.
<span class="lineNum">    5142 </span>            :    *  @param __is  Input stream.
<span class="lineNum">    5143 </span>            :    *  @param __str  Buffer to store into.
<span class="lineNum">    5144 </span>            :    *  @return  Reference to the input stream.
<span class="lineNum">    5145 </span>            :    *
<span class="lineNum">    5146 </span>            :    *  Stores characters from @a __is into @a __str until whitespace is
<span class="lineNum">    5147 </span>            :    *  found, the end of the stream is encountered, or str.max_size()
<span class="lineNum">    5148 </span>            :    *  is reached.  If is.width() is non-zero, that is the limit on the
<span class="lineNum">    5149 </span>            :    *  number of characters stored into @a __str.  Any previous
<span class="lineNum">    5150 </span>            :    *  contents of @a __str are erased.
<span class="lineNum">    5151 </span>            :    */
<span class="lineNum">    5152 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5153 </span>            :     basic_istream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5154 </span>            :     operator&gt;&gt;(basic_istream&lt;_CharT, _Traits&gt;&amp; __is,
<span class="lineNum">    5155 </span>            :                basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str);
<span class="lineNum">    5156 </span>            : 
<span class="lineNum">    5157 </span>            :   template&lt;&gt;
<span class="lineNum">    5158 </span>            :     basic_istream&lt;char&gt;&amp;
<span class="lineNum">    5159 </span>            :     operator&gt;&gt;(basic_istream&lt;char&gt;&amp; __is, basic_string&lt;char&gt;&amp; __str);
<span class="lineNum">    5160 </span>            : 
<span class="lineNum">    5161 </span>            :   /**
<span class="lineNum">    5162 </span>            :    *  @brief  Write string to a stream.
<span class="lineNum">    5163 </span>            :    *  @param __os  Output stream.
<span class="lineNum">    5164 </span>            :    *  @param __str  String to write out.
<span class="lineNum">    5165 </span>            :    *  @return  Reference to the output stream.
<span class="lineNum">    5166 </span>            :    *
<span class="lineNum">    5167 </span>            :    *  Output characters of @a __str into os following the same rules as for
<span class="lineNum">    5168 </span>            :    *  writing a C string.
<span class="lineNum">    5169 </span>            :    */
<span class="lineNum">    5170 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5171 </span>            :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5172 </span>            :     operator&lt;&lt;(basic_ostream&lt;_CharT, _Traits&gt;&amp; __os,
<span class="lineNum">    5173 </span>            :                const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str)
<span class="lineNum">    5174 </span>            :     {
<span class="lineNum">    5175 </span>            :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    5176 </span>            :       // 586. string inserter not a formatted function
<span class="lineNum">    5177 </span><span class="lineCov">        528 :       return __ostream_insert(__os, __str.data(), __str.size());</span>
<span class="lineNum">    5178 </span>            :     }
<span class="lineNum">    5179 </span>            : 
<span class="lineNum">    5180 </span>            :   /**
<span class="lineNum">    5181 </span>            :    *  @brief  Read a line from stream into a string.
<span class="lineNum">    5182 </span>            :    *  @param __is  Input stream.
<span class="lineNum">    5183 </span>            :    *  @param __str  Buffer to store into.
<span class="lineNum">    5184 </span>            :    *  @param __delim  Character marking end of line.
<span class="lineNum">    5185 </span>            :    *  @return  Reference to the input stream.
<span class="lineNum">    5186 </span>            :    *
<span class="lineNum">    5187 </span>            :    *  Stores characters from @a __is into @a __str until @a __delim is
<span class="lineNum">    5188 </span>            :    *  found, the end of the stream is encountered, or str.max_size()
<span class="lineNum">    5189 </span>            :    *  is reached.  Any previous contents of @a __str are erased.  If
<span class="lineNum">    5190 </span>            :    *  @a __delim is encountered, it is extracted but not stored into
<span class="lineNum">    5191 </span>            :    *  @a __str.
<span class="lineNum">    5192 </span>            :    */
<span class="lineNum">    5193 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5194 </span>            :     basic_istream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5195 </span>            :     getline(basic_istream&lt;_CharT, _Traits&gt;&amp; __is,
<span class="lineNum">    5196 </span>            :             basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str, _CharT __delim);
<span class="lineNum">    5197 </span>            : 
<span class="lineNum">    5198 </span>            :   /**
<span class="lineNum">    5199 </span>            :    *  @brief  Read a line from stream into a string.
<span class="lineNum">    5200 </span>            :    *  @param __is  Input stream.
<span class="lineNum">    5201 </span>            :    *  @param __str  Buffer to store into.
<span class="lineNum">    5202 </span>            :    *  @return  Reference to the input stream.
<span class="lineNum">    5203 </span>            :    *
<span class="lineNum">    5204 </span>            :    *  Stores characters from is into @a __str until &amp;apos;\n&amp;apos; is
<span class="lineNum">    5205 </span>            :    *  found, the end of the stream is encountered, or str.max_size()
<span class="lineNum">    5206 </span>            :    *  is reached.  Any previous contents of @a __str are erased.  If
<span class="lineNum">    5207 </span>            :    *  end of line is encountered, it is extracted but not stored into
<span class="lineNum">    5208 </span>            :    *  @a __str.
<span class="lineNum">    5209 </span>            :    */
<span class="lineNum">    5210 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5211 </span>            :     inline basic_istream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5212 </span>            :     getline(basic_istream&lt;_CharT, _Traits&gt;&amp; __is,
<span class="lineNum">    5213 </span>            :             basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str)
<span class="lineNum">    5214 </span>            :     { return std::getline(__is, __str, __is.widen('\n')); }
<span class="lineNum">    5215 </span>            : 
<span class="lineNum">    5216 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    5217 </span>            :   /// Read a line from an rvalue stream into a string.
<span class="lineNum">    5218 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5219 </span>            :     inline basic_istream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5220 </span>            :     getline(basic_istream&lt;_CharT, _Traits&gt;&amp;&amp; __is,
<span class="lineNum">    5221 </span>            :             basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str, _CharT __delim)
<span class="lineNum">    5222 </span>            :     { return std::getline(__is, __str, __delim); }
<span class="lineNum">    5223 </span>            : 
<span class="lineNum">    5224 </span>            :   /// Read a line from an rvalue stream into a string.
<span class="lineNum">    5225 </span>            :   template&lt;typename _CharT, typename _Traits, typename _Alloc&gt;
<span class="lineNum">    5226 </span>            :     inline basic_istream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">    5227 </span>            :     getline(basic_istream&lt;_CharT, _Traits&gt;&amp;&amp; __is,
<span class="lineNum">    5228 </span>            :             basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __str)
<span class="lineNum">    5229 </span>            :     { return std::getline(__is, __str); }
<span class="lineNum">    5230 </span>            : #endif
<span class="lineNum">    5231 </span>            : 
<span class="lineNum">    5232 </span>            :   template&lt;&gt;
<span class="lineNum">    5233 </span>            :     basic_istream&lt;char&gt;&amp;
<span class="lineNum">    5234 </span>            :     getline(basic_istream&lt;char&gt;&amp; __in, basic_string&lt;char&gt;&amp; __str,
<span class="lineNum">    5235 </span>            :             char __delim);
<span class="lineNum">    5236 </span>            : 
<span class="lineNum">    5237 </span>            : #ifdef _GLIBCXX_USE_WCHAR_T
<span class="lineNum">    5238 </span>            :   template&lt;&gt;
<span class="lineNum">    5239 </span>            :     basic_istream&lt;wchar_t&gt;&amp;
<span class="lineNum">    5240 </span>            :     getline(basic_istream&lt;wchar_t&gt;&amp; __in, basic_string&lt;wchar_t&gt;&amp; __str,
<span class="lineNum">    5241 </span>            :             wchar_t __delim);
<span class="lineNum">    5242 </span>            : #endif  
<span class="lineNum">    5243 </span>            : 
<span class="lineNum">    5244 </span>            : _GLIBCXX_END_NAMESPACE_VERSION
<span class="lineNum">    5245 </span>            : } // namespace
<span class="lineNum">    5246 </span>            : 
<span class="lineNum">    5247 </span>            : #if __cplusplus &gt;= 201103L &amp;&amp; defined(_GLIBCXX_USE_C99)
<span class="lineNum">    5248 </span>            : 
<span class="lineNum">    5249 </span>            : #include &lt;ext/string_conversions.h&gt;
<span class="lineNum">    5250 </span>            : 
<span class="lineNum">    5251 </span>            : namespace std _GLIBCXX_VISIBILITY(default)
<span class="lineNum">    5252 </span>            : {
<span class="lineNum">    5253 </span>            : _GLIBCXX_BEGIN_NAMESPACE_VERSION
<span class="lineNum">    5254 </span>            : _GLIBCXX_BEGIN_NAMESPACE_CXX11
<span class="lineNum">    5255 </span>            : 
<span class="lineNum">    5256 </span>            :   // 21.4 Numeric Conversions [string.conversions].
<span class="lineNum">    5257 </span>            :   inline int
<span class="lineNum">    5258 </span>            :   stoi(const string&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5259 </span>            :   { return __gnu_cxx::__stoa&lt;long, int&gt;(&amp;std::strtol, &quot;stoi&quot;, __str.c_str(),
<span class="lineNum">    5260 </span>            :                                         __idx, __base); }
<span class="lineNum">    5261 </span>            : 
<span class="lineNum">    5262 </span>            :   inline long
<span class="lineNum">    5263 </span>            :   stol(const string&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5264 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtol, &quot;stol&quot;, __str.c_str(),
<span class="lineNum">    5265 </span>            :                              __idx, __base); }
<span class="lineNum">    5266 </span>            : 
<span class="lineNum">    5267 </span>            :   inline unsigned long
<span class="lineNum">    5268 </span>            :   stoul(const string&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5269 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtoul, &quot;stoul&quot;, __str.c_str(),
<span class="lineNum">    5270 </span>            :                              __idx, __base); }
<span class="lineNum">    5271 </span>            : 
<span class="lineNum">    5272 </span>            :   inline long long
<span class="lineNum">    5273 </span>            :   stoll(const string&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5274 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtoll, &quot;stoll&quot;, __str.c_str(),
<span class="lineNum">    5275 </span>            :                              __idx, __base); }
<span class="lineNum">    5276 </span>            : 
<span class="lineNum">    5277 </span>            :   inline unsigned long long
<span class="lineNum">    5278 </span>            :   stoull(const string&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5279 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtoull, &quot;stoull&quot;, __str.c_str(),
<span class="lineNum">    5280 </span>            :                              __idx, __base); }
<span class="lineNum">    5281 </span>            : 
<span class="lineNum">    5282 </span>            :   // NB: strtof vs strtod.
<span class="lineNum">    5283 </span>            :   inline float
<span class="lineNum">    5284 </span>            :   stof(const string&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5285 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtof, &quot;stof&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5286 </span>            : 
<span class="lineNum">    5287 </span>            :   inline double
<span class="lineNum">    5288 </span>            :   stod(const string&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5289 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtod, &quot;stod&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5290 </span>            : 
<span class="lineNum">    5291 </span>            :   inline long double
<span class="lineNum">    5292 </span>            :   stold(const string&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5293 </span>            :   { return __gnu_cxx::__stoa(&amp;std::strtold, &quot;stold&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5294 </span>            : 
<span class="lineNum">    5295 </span>            :   // NB: (v)snprintf vs sprintf.
<span class="lineNum">    5296 </span>            : 
<span class="lineNum">    5297 </span>            :   // DR 1261.
<span class="lineNum">    5298 </span>            :   inline string
<span class="lineNum">    5299 </span>            :   to_string(int __val)
<span class="lineNum">    5300 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf, 4 * sizeof(int),
<span class="lineNum">    5301 </span>            :                                            &quot;%d&quot;, __val); }
<span class="lineNum">    5302 </span>            : 
<span class="lineNum">    5303 </span>            :   inline string
<span class="lineNum">    5304 </span>            :   to_string(unsigned __val)
<span class="lineNum">    5305 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf,
<span class="lineNum">    5306 </span>            :                                            4 * sizeof(unsigned),
<span class="lineNum">    5307 </span>            :                                            &quot;%u&quot;, __val); }
<span class="lineNum">    5308 </span>            : 
<span class="lineNum">    5309 </span>            :   inline string
<span class="lineNum">    5310 </span>            :   to_string(long __val)
<span class="lineNum">    5311 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf, 4 * sizeof(long),
<span class="lineNum">    5312 </span>            :                                            &quot;%ld&quot;, __val); }
<span class="lineNum">    5313 </span>            : 
<span class="lineNum">    5314 </span>            :   inline string
<span class="lineNum">    5315 </span>            :   to_string(unsigned long __val)
<span class="lineNum">    5316 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf,
<span class="lineNum">    5317 </span>            :                                            4 * sizeof(unsigned long),
<span class="lineNum">    5318 </span>            :                                            &quot;%lu&quot;, __val); }
<span class="lineNum">    5319 </span>            : 
<span class="lineNum">    5320 </span>            :   inline string
<span class="lineNum">    5321 </span>            :   to_string(long long __val)
<span class="lineNum">    5322 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf,
<span class="lineNum">    5323 </span>            :                                            4 * sizeof(long long),
<span class="lineNum">    5324 </span>            :                                            &quot;%lld&quot;, __val); }
<span class="lineNum">    5325 </span>            : 
<span class="lineNum">    5326 </span>            :   inline string
<span class="lineNum">    5327 </span>            :   to_string(unsigned long long __val)
<span class="lineNum">    5328 </span>            :   { return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf,
<span class="lineNum">    5329 </span>            :                                            4 * sizeof(unsigned long long),
<span class="lineNum">    5330 </span>            :                                            &quot;%llu&quot;, __val); }
<span class="lineNum">    5331 </span>            : 
<span class="lineNum">    5332 </span>            :   inline string
<span class="lineNum">    5333 </span>            :   to_string(float __val)
<span class="lineNum">    5334 </span>            :   {
<span class="lineNum">    5335 </span>            :     const int __n = 
<span class="lineNum">    5336 </span>            :       __gnu_cxx::__numeric_traits&lt;float&gt;::__max_exponent10 + 20;
<span class="lineNum">    5337 </span>            :     return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf, __n,
<span class="lineNum">    5338 </span>            :                                            &quot;%f&quot;, __val);
<span class="lineNum">    5339 </span>            :   }
<span class="lineNum">    5340 </span>            : 
<span class="lineNum">    5341 </span>            :   inline string
<span class="lineNum">    5342 </span>            :   to_string(double __val)
<span class="lineNum">    5343 </span>            :   {
<span class="lineNum">    5344 </span>            :     const int __n = 
<span class="lineNum">    5345 </span>            :       __gnu_cxx::__numeric_traits&lt;double&gt;::__max_exponent10 + 20;
<span class="lineNum">    5346 </span>            :     return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf, __n,
<span class="lineNum">    5347 </span>            :                                            &quot;%f&quot;, __val);
<span class="lineNum">    5348 </span>            :   }
<span class="lineNum">    5349 </span>            : 
<span class="lineNum">    5350 </span>            :   inline string
<span class="lineNum">    5351 </span>            :   to_string(long double __val)
<span class="lineNum">    5352 </span>            :   {
<span class="lineNum">    5353 </span>            :     const int __n = 
<span class="lineNum">    5354 </span>            :       __gnu_cxx::__numeric_traits&lt;long double&gt;::__max_exponent10 + 20;
<span class="lineNum">    5355 </span>            :     return __gnu_cxx::__to_xstring&lt;string&gt;(&amp;std::vsnprintf, __n,
<span class="lineNum">    5356 </span>            :                                            &quot;%Lf&quot;, __val);
<span class="lineNum">    5357 </span>            :   }
<span class="lineNum">    5358 </span>            : 
<span class="lineNum">    5359 </span>            : #ifdef _GLIBCXX_USE_WCHAR_T
<span class="lineNum">    5360 </span>            :   inline int 
<span class="lineNum">    5361 </span>            :   stoi(const wstring&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5362 </span>            :   { return __gnu_cxx::__stoa&lt;long, int&gt;(&amp;std::wcstol, &quot;stoi&quot;, __str.c_str(),
<span class="lineNum">    5363 </span>            :                                         __idx, __base); }
<span class="lineNum">    5364 </span>            : 
<span class="lineNum">    5365 </span>            :   inline long 
<span class="lineNum">    5366 </span>            :   stol(const wstring&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5367 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstol, &quot;stol&quot;, __str.c_str(),
<span class="lineNum">    5368 </span>            :                              __idx, __base); }
<span class="lineNum">    5369 </span>            : 
<span class="lineNum">    5370 </span>            :   inline unsigned long
<span class="lineNum">    5371 </span>            :   stoul(const wstring&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5372 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstoul, &quot;stoul&quot;, __str.c_str(),
<span class="lineNum">    5373 </span>            :                              __idx, __base); }
<span class="lineNum">    5374 </span>            : 
<span class="lineNum">    5375 </span>            :   inline long long
<span class="lineNum">    5376 </span>            :   stoll(const wstring&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5377 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstoll, &quot;stoll&quot;, __str.c_str(),
<span class="lineNum">    5378 </span>            :                              __idx, __base); }
<span class="lineNum">    5379 </span>            : 
<span class="lineNum">    5380 </span>            :   inline unsigned long long
<span class="lineNum">    5381 </span>            :   stoull(const wstring&amp; __str, size_t* __idx = 0, int __base = 10)
<span class="lineNum">    5382 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstoull, &quot;stoull&quot;, __str.c_str(),
<span class="lineNum">    5383 </span>            :                              __idx, __base); }
<span class="lineNum">    5384 </span>            : 
<span class="lineNum">    5385 </span>            :   // NB: wcstof vs wcstod.
<span class="lineNum">    5386 </span>            :   inline float
<span class="lineNum">    5387 </span>            :   stof(const wstring&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5388 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstof, &quot;stof&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5389 </span>            : 
<span class="lineNum">    5390 </span>            :   inline double
<span class="lineNum">    5391 </span>            :   stod(const wstring&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5392 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstod, &quot;stod&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5393 </span>            : 
<span class="lineNum">    5394 </span>            :   inline long double
<span class="lineNum">    5395 </span>            :   stold(const wstring&amp; __str, size_t* __idx = 0)
<span class="lineNum">    5396 </span>            :   { return __gnu_cxx::__stoa(&amp;std::wcstold, &quot;stold&quot;, __str.c_str(), __idx); }
<span class="lineNum">    5397 </span>            : 
<span class="lineNum">    5398 </span>            : #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
<span class="lineNum">    5399 </span>            :   // DR 1261.
<span class="lineNum">    5400 </span>            :   inline wstring
<span class="lineNum">    5401 </span>            :   to_wstring(int __val)
<span class="lineNum">    5402 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf, 4 * sizeof(int),
<span class="lineNum">    5403 </span>            :                                             L&quot;%d&quot;, __val); }
<span class="lineNum">    5404 </span>            : 
<span class="lineNum">    5405 </span>            :   inline wstring
<span class="lineNum">    5406 </span>            :   to_wstring(unsigned __val)
<span class="lineNum">    5407 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf,
<span class="lineNum">    5408 </span>            :                                             4 * sizeof(unsigned),
<span class="lineNum">    5409 </span>            :                                             L&quot;%u&quot;, __val); }
<span class="lineNum">    5410 </span>            : 
<span class="lineNum">    5411 </span>            :   inline wstring
<span class="lineNum">    5412 </span>            :   to_wstring(long __val)
<span class="lineNum">    5413 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf, 4 * sizeof(long),
<span class="lineNum">    5414 </span>            :                                             L&quot;%ld&quot;, __val); }
<span class="lineNum">    5415 </span>            : 
<span class="lineNum">    5416 </span>            :   inline wstring
<span class="lineNum">    5417 </span>            :   to_wstring(unsigned long __val)
<span class="lineNum">    5418 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf,
<span class="lineNum">    5419 </span>            :                                             4 * sizeof(unsigned long),
<span class="lineNum">    5420 </span>            :                                             L&quot;%lu&quot;, __val); }
<span class="lineNum">    5421 </span>            : 
<span class="lineNum">    5422 </span>            :   inline wstring
<span class="lineNum">    5423 </span>            :   to_wstring(long long __val)
<span class="lineNum">    5424 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf,
<span class="lineNum">    5425 </span>            :                                             4 * sizeof(long long),
<span class="lineNum">    5426 </span>            :                                             L&quot;%lld&quot;, __val); }
<span class="lineNum">    5427 </span>            : 
<span class="lineNum">    5428 </span>            :   inline wstring
<span class="lineNum">    5429 </span>            :   to_wstring(unsigned long long __val)
<span class="lineNum">    5430 </span>            :   { return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf,
<span class="lineNum">    5431 </span>            :                                             4 * sizeof(unsigned long long),
<span class="lineNum">    5432 </span>            :                                             L&quot;%llu&quot;, __val); }
<span class="lineNum">    5433 </span>            : 
<span class="lineNum">    5434 </span>            :   inline wstring
<span class="lineNum">    5435 </span>            :   to_wstring(float __val)
<span class="lineNum">    5436 </span>            :   {
<span class="lineNum">    5437 </span>            :     const int __n =
<span class="lineNum">    5438 </span>            :       __gnu_cxx::__numeric_traits&lt;float&gt;::__max_exponent10 + 20;
<span class="lineNum">    5439 </span>            :     return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf, __n,
<span class="lineNum">    5440 </span>            :                                             L&quot;%f&quot;, __val);
<span class="lineNum">    5441 </span>            :   }
<span class="lineNum">    5442 </span>            : 
<span class="lineNum">    5443 </span>            :   inline wstring
<span class="lineNum">    5444 </span>            :   to_wstring(double __val)
<span class="lineNum">    5445 </span>            :   {
<span class="lineNum">    5446 </span>            :     const int __n =
<span class="lineNum">    5447 </span>            :       __gnu_cxx::__numeric_traits&lt;double&gt;::__max_exponent10 + 20;
<span class="lineNum">    5448 </span>            :     return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf, __n,
<span class="lineNum">    5449 </span>            :                                             L&quot;%f&quot;, __val);
<span class="lineNum">    5450 </span>            :   }
<span class="lineNum">    5451 </span>            : 
<span class="lineNum">    5452 </span>            :   inline wstring
<span class="lineNum">    5453 </span>            :   to_wstring(long double __val)
<span class="lineNum">    5454 </span>            :   {
<span class="lineNum">    5455 </span>            :     const int __n =
<span class="lineNum">    5456 </span>            :       __gnu_cxx::__numeric_traits&lt;long double&gt;::__max_exponent10 + 20;
<span class="lineNum">    5457 </span>            :     return __gnu_cxx::__to_xstring&lt;wstring&gt;(&amp;std::vswprintf, __n,
<span class="lineNum">    5458 </span>            :                                             L&quot;%Lf&quot;, __val);
<span class="lineNum">    5459 </span>            :   }
<span class="lineNum">    5460 </span>            : #endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
<span class="lineNum">    5461 </span>            : #endif
<span class="lineNum">    5462 </span>            : 
<span class="lineNum">    5463 </span>            : _GLIBCXX_END_NAMESPACE_CXX11
<span class="lineNum">    5464 </span>            : _GLIBCXX_END_NAMESPACE_VERSION
<span class="lineNum">    5465 </span>            : } // namespace
<span class="lineNum">    5466 </span>            : 
<span class="lineNum">    5467 </span>            : #endif /* C++11 &amp;&amp; _GLIBCXX_USE_C99 ... */
<span class="lineNum">    5468 </span>            : 
<span class="lineNum">    5469 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">    5470 </span>            : 
<span class="lineNum">    5471 </span>            : #include &lt;bits/functional_hash.h&gt;
<span class="lineNum">    5472 </span>            : 
<span class="lineNum">    5473 </span>            : namespace std _GLIBCXX_VISIBILITY(default)
<span class="lineNum">    5474 </span>            : {
<span class="lineNum">    5475 </span>            : _GLIBCXX_BEGIN_NAMESPACE_VERSION
<span class="lineNum">    5476 </span>            : 
<span class="lineNum">    5477 </span>            :   // DR 1182.
<span class="lineNum">    5478 </span>            : 
<span class="lineNum">    5479 </span>            : #ifndef _GLIBCXX_COMPATIBILITY_CXX0X
<span class="lineNum">    5480 </span>            :   /// std::hash specialization for string.
<span class="lineNum">    5481 </span>            :   template&lt;&gt;
<span class="lineNum">    5482 </span>            :     struct hash&lt;string&gt;
<span class="lineNum">    5483 </span>            :     : public __hash_base&lt;size_t, string&gt;
<span class="lineNum">    5484 </span>            :     {
<span class="lineNum">    5485 </span>            :       size_t
<span class="lineNum">    5486 </span>            :       operator()(const string&amp; __s) const noexcept
<span class="lineNum">    5487 </span>            :       { return std::_Hash_impl::hash(__s.data(), __s.length()); }
<span class="lineNum">    5488 </span>            :     };
<span class="lineNum">    5489 </span>            : 
<span class="lineNum">    5490 </span>            :   template&lt;&gt;
<span class="lineNum">    5491 </span>            :     struct __is_fast_hash&lt;hash&lt;string&gt;&gt; : std::false_type
<span class="lineNum">    5492 </span>            :     { };
<span class="lineNum">    5493 </span>            : 
<span class="lineNum">    5494 </span>            : #ifdef _GLIBCXX_USE_WCHAR_T
<span class="lineNum">    5495 </span>            :   /// std::hash specialization for wstring.
<span class="lineNum">    5496 </span>            :   template&lt;&gt;
<span class="lineNum">    5497 </span>            :     struct hash&lt;wstring&gt;
<span class="lineNum">    5498 </span>            :     : public __hash_base&lt;size_t, wstring&gt;
<span class="lineNum">    5499 </span>            :     {
<span class="lineNum">    5500 </span>            :       size_t
<span class="lineNum">    5501 </span>            :       operator()(const wstring&amp; __s) const noexcept
<span class="lineNum">    5502 </span>            :       { return std::_Hash_impl::hash(__s.data(),
<span class="lineNum">    5503 </span>            :                                      __s.length() * sizeof(wchar_t)); }
<span class="lineNum">    5504 </span>            :     };
<span class="lineNum">    5505 </span>            : 
<span class="lineNum">    5506 </span>            :   template&lt;&gt;
<span class="lineNum">    5507 </span>            :     struct __is_fast_hash&lt;hash&lt;wstring&gt;&gt; : std::false_type
<span class="lineNum">    5508 </span>            :     { };
<span class="lineNum">    5509 </span>            : #endif
<span class="lineNum">    5510 </span>            : #endif /* _GLIBCXX_COMPATIBILITY_CXX0X */
<span class="lineNum">    5511 </span>            : 
<span class="lineNum">    5512 </span>            : #ifdef _GLIBCXX_USE_C99_STDINT_TR1
<span class="lineNum">    5513 </span>            :   /// std::hash specialization for u16string.
<span class="lineNum">    5514 </span>            :   template&lt;&gt;
<span class="lineNum">    5515 </span>            :     struct hash&lt;u16string&gt;
<span class="lineNum">    5516 </span>            :     : public __hash_base&lt;size_t, u16string&gt;
<span class="lineNum">    5517 </span>            :     {
<span class="lineNum">    5518 </span>            :       size_t
<span class="lineNum">    5519 </span>            :       operator()(const u16string&amp; __s) const noexcept
<span class="lineNum">    5520 </span>            :       { return std::_Hash_impl::hash(__s.data(),
<span class="lineNum">    5521 </span>            :                                      __s.length() * sizeof(char16_t)); }
<span class="lineNum">    5522 </span>            :     };
<span class="lineNum">    5523 </span>            : 
<span class="lineNum">    5524 </span>            :   template&lt;&gt;
<span class="lineNum">    5525 </span>            :     struct __is_fast_hash&lt;hash&lt;u16string&gt;&gt; : std::false_type
<span class="lineNum">    5526 </span>            :     { };
<span class="lineNum">    5527 </span>            : 
<span class="lineNum">    5528 </span>            :   /// std::hash specialization for u32string.
<span class="lineNum">    5529 </span>            :   template&lt;&gt;
<span class="lineNum">    5530 </span>            :     struct hash&lt;u32string&gt;
<span class="lineNum">    5531 </span>            :     : public __hash_base&lt;size_t, u32string&gt;
<span class="lineNum">    5532 </span>            :     {
<span class="lineNum">    5533 </span>            :       size_t
<span class="lineNum">    5534 </span>            :       operator()(const u32string&amp; __s) const noexcept
<span class="lineNum">    5535 </span>            :       { return std::_Hash_impl::hash(__s.data(),
<span class="lineNum">    5536 </span>            :                                      __s.length() * sizeof(char32_t)); }
<span class="lineNum">    5537 </span>            :     };
<span class="lineNum">    5538 </span>            : 
<span class="lineNum">    5539 </span>            :   template&lt;&gt;
<span class="lineNum">    5540 </span>            :     struct __is_fast_hash&lt;hash&lt;u32string&gt;&gt; : std::false_type
<span class="lineNum">    5541 </span>            :     { };
<span class="lineNum">    5542 </span>            : #endif
<span class="lineNum">    5543 </span>            : 
<span class="lineNum">    5544 </span>            : #if __cplusplus &gt; 201103L
<span class="lineNum">    5545 </span>            : 
<span class="lineNum">    5546 </span>            : #define __cpp_lib_string_udls 201304
<span class="lineNum">    5547 </span>            : 
<span class="lineNum">    5548 </span>            :   inline namespace literals
<span class="lineNum">    5549 </span>            :   {
<span class="lineNum">    5550 </span>            :   inline namespace string_literals
<span class="lineNum">    5551 </span>            :   {
<span class="lineNum">    5552 </span>            : 
<span class="lineNum">    5553 </span>            :     _GLIBCXX_DEFAULT_ABI_TAG
<span class="lineNum">    5554 </span>            :     inline basic_string&lt;char&gt;
<span class="lineNum">    5555 </span>            :     operator&quot;&quot;s(const char* __str, size_t __len)
<span class="lineNum">    5556 </span>            :     { return basic_string&lt;char&gt;{__str, __len}; }
<span class="lineNum">    5557 </span>            : 
<span class="lineNum">    5558 </span>            : #ifdef _GLIBCXX_USE_WCHAR_T
<span class="lineNum">    5559 </span>            :     _GLIBCXX_DEFAULT_ABI_TAG
<span class="lineNum">    5560 </span>            :     inline basic_string&lt;wchar_t&gt;
<span class="lineNum">    5561 </span>            :     operator&quot;&quot;s(const wchar_t* __str, size_t __len)
<span class="lineNum">    5562 </span>            :     { return basic_string&lt;wchar_t&gt;{__str, __len}; }
<span class="lineNum">    5563 </span>            : #endif
<span class="lineNum">    5564 </span>            : 
<span class="lineNum">    5565 </span>            : #ifdef _GLIBCXX_USE_C99_STDINT_TR1
<span class="lineNum">    5566 </span>            :     _GLIBCXX_DEFAULT_ABI_TAG
<span class="lineNum">    5567 </span>            :     inline basic_string&lt;char16_t&gt;
<span class="lineNum">    5568 </span>            :     operator&quot;&quot;s(const char16_t* __str, size_t __len)
<span class="lineNum">    5569 </span>            :     { return basic_string&lt;char16_t&gt;{__str, __len}; }
<span class="lineNum">    5570 </span>            : 
<span class="lineNum">    5571 </span>            :     _GLIBCXX_DEFAULT_ABI_TAG
<span class="lineNum">    5572 </span>            :     inline basic_string&lt;char32_t&gt;
<span class="lineNum">    5573 </span>            :     operator&quot;&quot;s(const char32_t* __str, size_t __len)
<span class="lineNum">    5574 </span>            :     { return basic_string&lt;char32_t&gt;{__str, __len}; }
<span class="lineNum">    5575 </span>            : #endif
<span class="lineNum">    5576 </span>            : 
<span class="lineNum">    5577 </span>            :   } // inline namespace string_literals
<span class="lineNum">    5578 </span>            :   } // inline namespace literals
<span class="lineNum">    5579 </span>            : 
<span class="lineNum">    5580 </span>            : #endif // __cplusplus &gt; 201103L
<span class="lineNum">    5581 </span>            : 
<span class="lineNum">    5582 </span>            : _GLIBCXX_END_NAMESPACE_VERSION
<span class="lineNum">    5583 </span>            : } // namespace std
<span class="lineNum">    5584 </span>            : 
<span class="lineNum">    5585 </span>            : #endif // C++11
<span class="lineNum">    5586 </span>            : 
<span class="lineNum">    5587 </span>            : #endif /* _BASIC_STRING_H */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
